Bases: matplotlib.offsetbox.AnchoredOffsetbox
Draw two perpendicular arrows to indicate directions.
matplotlib.transforms.Transform
The transformation object for the coordinate system in use, i.e., matplotlib.axes.Axes.transAxes
.
Label text for the x and y arrows
Length of the arrow, given in coordinates of transform.
Size of label strings, given in coordinates of transform.
Location of this ellipse. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend
for details.
The angle of the arrows in degrees.
The ratio of the length of arrow_x and arrow_y. Negative numbers can be used to change the direction.
Padding around the labels and arrows, in fraction of the font size.
Border padding, in fraction of the font size.
If True, draw a box around the arrows and labels.
Color for the arrows and labels.
Alpha values of the arrows and labels
Separation between the arrows and labels in coordinates of transform.
matplotlib.font_manager.FontProperties
, optional
Font properties for the label text.
Fraction of the arrow behind the arrow crossing.
Width of arrow head, sent to ArrowStyle.
Length of arrow head, sent to ArrowStyle.
Width of arrow tail, sent to ArrowStyle.
Properties of the text and arrows, passed to textpath.TextPath
and patches.FancyArrowPatch
.
Keyword arguments forwarded to AnchoredOffsetbox
.
If prop is passed as a keyword argument, but fontproperties is not, then prop is be assumed to be the intended fontproperties. Using both prop and fontproperties is not supported.
>>> import matplotlib.pyplot as plt >>> import numpy as np >>> from mpl_toolkits.axes_grid1.anchored_artists import ( ... AnchoredDirectionArrows) >>> fig, ax = plt.subplots() >>> ax.imshow(np.random.random((10, 10))) >>> arrows = AnchoredDirectionArrows(ax.transAxes, '111', '110') >>> ax.add_artist(arrows) >>> fig.show()
Using several of the optional parameters, creating downward pointing arrow and high contrast text labels.
>>> import matplotlib.font_manager as fm >>> fontprops = fm.FontProperties(family='monospace') >>> arrows = AnchoredDirectionArrows(ax.transAxes, 'East', 'South', ... loc='lower left', color='k', ... aspect_ratio=-1, sep_x=0.02, ... sep_y=-0.01, ... text_props={'ec':'w', 'fc':'k'}, ... fontproperties=fontprops)
matplotlib.patches.FancyArrowPatch
Arrow x and y
matplotlib.textpath.TextPath
Path for arrow labels
matplotlib.patches.PathPatch
Patch for arrow labels
matplotlib.offsetbox.AuxTransformBox
Container for the arrows and labels.
Set multiple properties at once.
Supported properties are
Property | Description |
---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array | |
scalar or None | |
bool | |
unknown | |
unknown | |
bool | |
Patch or (Path, Transform) or None | |
str | |
float | |
bool | |
object | |
(float, float) or callable | |
None or bool or float or callable | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
bool | |
float | |
float |
mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows.html