mpl_arrow package#

Module contents#

Easily plot nice-looking arrows with matplotlib.

mpl_arrow.arrow(x, y, dx, dy, ax=None, **kwargs)#

Plot an arrow with a base and offset defined in data space.

Parameters:
  • x (float) – The x-coordinate of the arrow’s base.

  • y (float) – The y-coordinate of the arrow’s base.

  • dx (float) – The x component from the base to tip.

  • dy (float) – The x component from the base to tip.

  • ax (axis, optional) – If None get the current axis from pyplot

  • **kwargsFancyArrowPatch properties.

Return type:

FancyArrowPatch

mpl_arrow.arrow_absolute(x, y, x2, y2, ax=None, **kwargs)#

Plot an arrow between two points in data space.

Parameters:
  • x (float) – The x-coordinate of the arrows’s base.

  • y (float) – The y-coordinate of the arrows’s base.

  • x2 (float) – The x-coordinate of the arrows’s tip.

  • y2 (float) – The y-coordinate of the arrows’s tip.

  • ax (axis, optional) – If None get the current axis from pyplot

  • **kwargsFancyArrowPatch properties.

Return type:

FancyArrowPatch

mpl_arrow.vector(dx, dy, x=0, y=0, ax=None, **kwargs)#

Plot an arrow indicating a vector.

Parameters:
  • dx (float) – The x-component of the vector

  • dy (float) – The y-component of the vector

  • x (float (optional)) – The x-coordinate of the vector’s base if nonzero.

  • y (float (optional)) – The y-coordinate of the vector’s base if nonzero.

  • ax (axis, optional) – If None get the current axis from pyplot

  • **kwargsFancyArrowPatch properties.

Return type:

FancyArrowPatch