MEP 29 (arrows)
Table of Contents
David Stansby
08/03/2017
This is a proposal to reorganise the ability to plot individual arrows.
Discussion
Currently Matplotlib has many different functions available to users to plot individual arrows on figures. Much functionality is duplicated, and there is currently not one agreed function to carry out this task. The end goal of this proposal is to provide a single function for users to plot individual arrows, and then deprecate and eventually remove the current functions available.
Plotting arrows fall into two categories:
- Arrows fixed in 'display space'
- Arrows fixed in 'data space'
- Clean up FancyArrowPatch (maintain API)
- Modify matplotlib.axes.Axes.arrow to switch to FancyArrowPatch for drawing
- Deprecate old functions
Users may rely on a mixture of the current functions available. Eventually this proposal plans to remove the current functions after a suitable deprecation cycle.
- matplotlib.axes.Axes.arrow (uses FancyArrow)
- matplotlib.axes.Axes.annotate (uses FancyArrowPatch)
- matplotlib.patches.FancyArrowPatch (uses ArrowStyle)
- matplotlib.patches.Arrow: All vertices of the patch are fixed in data space
- matplotlib.patches.ArrowStyle: Head and tail location fixed in data space, head/tail shape/size fixed in display space
- matplotlib.patches.FancyArrow: All vertices of the patch are fixed in data space
- matplotlib.patches.YAArrow
It is proposed that the two functions listed below are kept and rewritten/fixed to become the two go-to functions for plotting single arrows:
Display space - matplotlib.patches.YAArrow
Data space - matplotlib.patches.FancyArrowPatch
It is also proposed that FancyArrow is deprecated, as neither of the two above functions depends on them.