Skip to content

MEP 29 (arrows)

David Stansby edited this page Jun 17, 2017 · 4 revisions

Table of Contents

David Stansby

08/03/2017

Abstract

This is a proposal to reorganise the ability to plot individual arrows.

Status

Discussion

Detailed description

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.

Arrow plotting requirements

Plotting arrows fall into two categories:

  • Arrows fixed in 'display space'
  • Arrows fixed in 'data space'

Implementation

  1. Clean up FancyArrowPatch (maintain API)
  2. Modify matplotlib.axes.Axes.arrow to switch to FancyArrowPatch for drawing
  3. Deprecate old functions

Backward compatibility

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.

Current arrow plotting functions

Proposed arrow plotting functions

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.

Branches and Pull requests

Alternatives