Drawing arrows on Axes

I used sagemath which uses matplotlib as its plotting interface. After extensive investigation I was extremely disappointed to find that matplotlib has no fundamental support for drawing arrows at the ends of axes.

Is there no way that such basic functionality could be included in the next matplotlib release. Add-ons such as artistsaxis are not really appropriate as they require extensive refactoring of code using splines or axes.

A simple "endarrow=True" option on either splines or axes would be a very useful addition to the axis interface. Many people would be very grateful if you could consider adding this feature in the next release.

Agreed, this would be a wonderful feature, and is often requested. The AxesGrid toolkit does provide this functionality

http://matplotlib.sourceforge.net/examples/axes_grid/demo_axisline_style.html

but it would be nice to eventually move some of this into the standard matplotlib axes object.

Two of the hurdles I foresee are:
* API – there are many kinds of arrows and I am sure once this ability is added, users are going to want to tweak the appearance. We will need to have an easy way to turn them on, select which axes to have them for, the type of arrow and their size and other properties. Finally, I am sure this will need to be at least partly accessible through rcparams.

* Locating -- If we place the arrowhead at the very end of the axis spine, we possibly run the risk of the arrowhead being clipped by the bounding box rectangle.  We would also need it to be taken into account for tight_layout and for bbox_inches='tight'.  On the other hand, one could position the arrow head such that the tip of the arrow is at the end of the spine, but one runs the risk of colliding with the tick and tick labels.

By no means should this discourage someone from attempting this. But I wanted to outline some of the considerations one would need to take into account while creating this feature.

Cheers!
Ben Root

···

On Thu, Jul 19, 2012 at 3:17 PM, ObsessiveMathsFreak <obsessivemathsfreak@…287…> wrote:

I used sagemath which uses matplotlib as its plotting interface. After

extensive investigation I was extremely disappointed to find that

matplotlib has no fundamental support for drawing arrows at the ends of

axes.

Is there no way that such basic functionality could be included in the

next matplotlib release. Add-ons such as artistsaxis are not really

appropriate as they require extensive refactoring of code using splines

or axes.

A simple “endarrow=True” option on either splines or axes would be a

very useful addition to the axis interface. Many people would be very

grateful if you could consider adding this feature in the next release.