mpl.patches.ArrowStyle¶
-
class
mpl.patches.ArrowStyle[source]¶ ArrowStyleis a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. These are mainly used withFancyArrowPatch.A arrowstyle object can be either created as:
ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
or:
ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
or:
ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
The following classes are defined
Class Name Attrs Curve -None CurveB ->head_length=0.4,head_width=0.2 BracketB -[widthB=1.0,lengthB=0.2,angleB=None CurveFilledB -|>head_length=0.4,head_width=0.2 CurveA <-head_length=0.4,head_width=0.2 CurveAB <->head_length=0.4,head_width=0.2 CurveFilledA <|-head_length=0.4,head_width=0.2 CurveFilledAB <|-|>head_length=0.4,head_width=0.2 BracketA ]-widthA=1.0,lengthA=0.2,angleA=None BracketAB ]-[widthA=1.0,lengthA=0.2,angleA=None,widthB=1.0,lengthB=0.2,angleB=None Fancy fancyhead_length=0.4,head_width=0.4,tail_width=0.4 Simple simplehead_length=0.5,head_width=0.5,tail_width=0.2 Wedge wedgetail_width=0.3,shrink_factor=0.5 BarAB |-|widthA=1.0,angleA=None,widthB=1.0,angleB=None An instance of any arrow style class is a callable object, whose call signature is:
__call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
and it returns a tuple of a
Pathinstance and a boolean value. path is aPathinstance along which the arrow will be drawn. mutation_size and aspect_ratio have the same meaning as inBoxStyle. linewidth is a line width to be stroked. This is meant to be used to correct the location of the head so that it does not overshoot the destination point, but not all classes support it.-
__init__¶ x.__init__(...) initializes x; see help(type(x)) for signature
-
Methods¶
get_styles(klass) |
A class method which returns a dictionary of available styles. |
pprint_styles(klass) |
A class method which returns a string of the available styles. |
register(klass, name, style) |
Register a new style. |