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