@@ -2335,7 +2335,7 @@ def get_styles(cls):
2335
2335
@classmethod
2336
2336
def pprint_styles (cls ):
2337
2337
"""Return the available styles as pretty-printed string."""
2338
- table = [('Class' , 'Name' , 'Attrs ' ),
2338
+ table = [('Class' , 'Name' , 'Parameters ' ),
2339
2339
* [(cls .__name__ ,
2340
2340
# Add backquotes, as - and | have special meaning in reST.
2341
2341
f'``{ name } ``' ,
@@ -4159,49 +4159,90 @@ def __init__(self, posA=None, posB=None, *,
4159
4159
patchA = None , patchB = None , shrinkA = 2 , shrinkB = 2 ,
4160
4160
mutation_scale = 1 , mutation_aspect = 1 , ** kwargs ):
4161
4161
"""
4162
- There are two ways for defining an arrow:
4162
+ **Defining the arrow position and path**
4163
4163
4164
- - If *posA* and *posB* are given, a path connecting two points is
4165
- created according to *connectionstyle*. The path will be
4166
- clipped with *patchA* and *patchB* and further shrunken by
4167
- *shrinkA* and *shrinkB*. An arrow is drawn along this
4168
- resulting path using the *arrowstyle* parameter.
4164
+ There are two ways to define the arrow position and path:
4169
4165
4170
- - Alternatively if *path* is provided, an arrow is drawn along this
4171
- path and *patchA*, *patchB*, *shrinkA*, and *shrinkB* are ignored.
4166
+ - **Start, end and connection**:
4167
+ The typical approach is to define the start and end points of the
4168
+ arrow using *posA* and *posB*. The curve between these two can
4169
+ further be configured using *connectionstyle*.
4170
+
4171
+ If given, the arrow curve is clipped by *patchA* and *patchB*,
4172
+ allowing it to start/end at the border of these patches.
4173
+ Additionally, the arrow curve can be shortened by *shrinkA* and *shrinkB*
4174
+ to create a margin between start/end (after possible clipping) and the
4175
+ drawn arrow.
4176
+
4177
+ - **path**: Alternatively if *path* is provided, an arrow is drawn along
4178
+ this Path. In this case, *connectionstyle*, *patchA*, *patchB*,
4179
+ *shrinkA*, and *shrinkB* are ignored.
4180
+
4181
+ **Styling**
4182
+
4183
+ The *arrowstyle* defines the styling of the arrow head, tail and shaft.
4184
+ The resulting arrows can be styled further by setting the `.Patch`
4185
+ properties such as *linewidth*, *color*, *facecolor*, *edgecolor*
4186
+ etc. via keyword arguments.
4172
4187
4173
4188
Parameters
4174
4189
----------
4175
- posA, posB : (float, float), default: None
4176
- (x, y) coordinates of arrow tail and arrow head respectively.
4190
+ posA, posB : (float, float), optional
4191
+ (x, y) coordinates of start and end point of the arrow.
4192
+ The actually drawn start and end positions may be modified
4193
+ through *patchA*, *patchB*, *shrinkA*, and *shrinkB*.
4177
4194
4178
- path : `~matplotlib.path.Path`, default: None
4195
+ *posA*, *posB* are exclusive of *path*.
4196
+
4197
+ path : `~matplotlib.path.Path`, optional
4179
4198
If provided, an arrow is drawn along this path and *patchA*,
4180
4199
*patchB*, *shrinkA*, and *shrinkB* are ignored.
4181
4200
4201
+ *path* is exclusive of *posA*, *posB*.
4202
+
4182
4203
arrowstyle : str or `.ArrowStyle`, default: 'simple'
4183
- The `.ArrowStyle` with which the fancy arrow is drawn. If a
4184
- string, it should be one of the available arrowstyle names, with
4185
- optional comma-separated attributes. The optional attributes are
4186
- meant to be scaled with the *mutation_scale*. The following arrow
4187
- styles are available:
4204
+ The styling of arrow head, tail and shaft. This can be
4205
+
4206
+ - `.ArrowStyle` or one of its subclasses
4207
+ - The shorthand string name (e.g. "->") as given in the table below,
4208
+ optionally containing a comma-separated list of style parameters,
4209
+ e.g. "->, head_length=10, head_width=5".
4210
+
4211
+ The style parameters are scaled by *mutation_scale*.
4212
+
4213
+ The following arrow styles are available. See also
4214
+ :doc:`/gallery/text_labels_and_annotations/fancyarrow_demo`.
4188
4215
4189
4216
%(ArrowStyle:table)s
4190
4217
4218
+ Only the styles ``<|-``, ``-|>``, ``<|-|>`` ``simple``, ``fancy``
4219
+ and ``wedge`` contain closed paths and can be filled.
4220
+
4191
4221
connectionstyle : str or `.ConnectionStyle` or None, optional, \
4192
4222
default: 'arc3'
4193
- The `.ConnectionStyle` with which *posA* and *posB* are connected.
4194
- If a string, it should be one of the available connectionstyle
4195
- names, with optional comma-separated attributes. The following
4196
- connection styles are available:
4223
+ `.ConnectionStyle` with which *posA* and *posB* are connected.
4224
+ This can be
4225
+
4226
+ - `.ConnectionStyle` or one of its subclasses
4227
+ - The shorthand string name as given in the table below, e.g. "arc3".
4197
4228
4198
4229
%(ConnectionStyle:table)s
4199
4230
4231
+ Ignored if *path* is provided.
4232
+
4200
4233
patchA, patchB : `~matplotlib.patches.Patch`, default: None
4201
- Head and tail patches, respectively.
4234
+ Optional Patches at *posA* and *posB*, respectively. If given,
4235
+ the arrow path is clipped by these patches such that head and tail
4236
+ are at the border of the patches.
4237
+
4238
+ Ignored if *path* is provided.
4202
4239
4203
4240
shrinkA, shrinkB : float, default: 2
4204
- Shrink amount, in points, of the tail and head of the arrow respectively.
4241
+ Shorten the arrow path at *posA* and *posB* by this amount in points.
4242
+ This allows to add a margin between the intended start/end points and
4243
+ the arrow.
4244
+
4245
+ Ignored if *path* is provided.
4205
4246
4206
4247
mutation_scale : float, default: 1
4207
4248
Value with which attributes of *arrowstyle* (e.g., *head_length*)
0 commit comments