@@ -99,9 +99,8 @@ def get_verts(self):
99
99
"""
100
100
Return a copy of the vertices used in this patch.
101
101
102
- If the patch contains Bezier curves, the curves will be
103
- interpolated by line segments. To access the curves as
104
- curves, use :meth:`get_path`.
102
+ If the patch contains Bezier curves, the curves will be interpolated by
103
+ line segments. To access the curves as curves, use `get_path`.
105
104
"""
106
105
trans = self .get_transform ()
107
106
path = self .get_path ()
@@ -263,15 +262,15 @@ def get_transform(self):
263
262
264
263
def get_data_transform (self ):
265
264
"""
266
- Return the :class:`~matplotlib .transforms.Transform` instance which
267
- maps data coordinates to physical coordinates.
265
+ Return the `~ .transforms.Transform` mapping data coordinates to
266
+ physical coordinates.
268
267
"""
269
268
return artist .Artist .get_transform (self )
270
269
271
270
def get_patch_transform (self ):
272
271
"""
273
- Return the :class:`~matplotlib .transforms.Transform` instance which
274
- takes patch coordinates to data coordinates.
272
+ Return the `~ .transforms.Transform` instance mapping patch coordinates
273
+ to data coordinates.
275
274
276
275
For example, one may define a patch of a circle which represents a
277
276
radius of 5 by providing coordinates for a unit circle, and a
@@ -968,7 +967,7 @@ def __str__(self):
968
967
@docstring .dedent_interpd
969
968
def __init__ (self , path , ** kwargs ):
970
969
"""
971
- *path* is a :class:`matplotlib .path.Path` object.
970
+ *path* is a `~ .path.Path` object.
972
971
973
972
Valid keyword arguments are:
974
973
@@ -1211,9 +1210,9 @@ def __init__(self, x, y, dx, dy, width=1.0, **kwargs):
1211
1210
1212
1211
See Also
1213
1212
--------
1214
- :class:` FancyArrow` :
1213
+ FancyArrow
1215
1214
Patch that allows independent control of the head and tail
1216
- properties
1215
+ properties.
1217
1216
"""
1218
1217
super ().__init__ (** kwargs )
1219
1218
self ._patch_transform = (
@@ -1349,9 +1348,9 @@ def __init__(self, xy, radius=5,
1349
1348
** kwargs ):
1350
1349
"""
1351
1350
Create a circle at *xy* = (*x*, *y*) with given *radius*.
1352
- This circle is approximated by a regular polygon with
1353
- *resolution* sides. For a smoother circle drawn with splines,
1354
- see :class:`~matplotlib.patches. Circle`.
1351
+
1352
+ This circle is approximated by a regular polygon with *resolution*
1353
+ sides. For a smoother circle drawn with splines, see ` Circle`.
1355
1354
1356
1355
Valid keyword arguments are:
1357
1356
@@ -1463,10 +1462,10 @@ def __str__(self):
1463
1462
@docstring .dedent_interpd
1464
1463
def __init__ (self , xy , radius = 5 , ** kwargs ):
1465
1464
"""
1466
- Create true circle at center *xy* = (*x*, *y*) with given
1467
- *radius*. Unlike :class:`~matplotlib.patches.CirclePolygon`
1468
- which is a polygonal approximation, this uses Bezier splines
1469
- and is much closer to a scale-free circle.
1465
+ Create a true circle at center *xy* = (*x*, *y*) with given *radius*.
1466
+
1467
+ Unlike `CirclePolygon` which is a polygonal approximation, this uses
1468
+ Bezier splines and is much closer to a scale-free circle.
1470
1469
1471
1470
Valid keyword arguments are:
1472
1471
@@ -1503,7 +1502,7 @@ class Arc(Ellipse):
1503
1502
1504
1503
- The arc cannot be filled.
1505
1504
1506
- - The arc must be used in an :class: `~.axes.Axes` instance---it can not be
1505
+ - The arc must be used in an `~.axes.Axes` instance---it can not be
1507
1506
added directly to a `.Figure`---because it is optimized to only render
1508
1507
the segments that are inside the axes bounding box with high resolution.
1509
1508
"""
@@ -1605,8 +1604,7 @@ def draw(self, renderer):
1605
1604
3. Proceeding counterclockwise starting in the positive
1606
1605
x-direction, each of the visible arc-segments between the
1607
1606
pairs of vertices are drawn using the Bezier arc
1608
- approximation technique implemented in
1609
- :meth:`matplotlib.path.Path.arc`.
1607
+ approximation technique implemented in `.Path.arc`.
1610
1608
"""
1611
1609
if not hasattr (self , 'axes' ):
1612
1610
raise RuntimeError ('Arcs can only be used in Axes instances' )
@@ -1705,8 +1703,7 @@ def segment_circle_intersect(x0, y0, x1, y1):
1705
1703
def bbox_artist (artist , renderer , props = None , fill = True ):
1706
1704
"""
1707
1705
This is a debug function to draw a rectangle around the bounding
1708
- box returned by
1709
- :meth:`~matplotlib.artist.Artist.get_window_extent` of an artist,
1706
+ box returned by an artist's `.Artist.get_window_extent`
1710
1707
to test whether the artist is returning the correct bbox.
1711
1708
1712
1709
*props* is a dict of rectangle props with the additional property
@@ -1737,8 +1734,7 @@ def bbox_artist(artist, renderer, props=None, fill=True):
1737
1734
def draw_bbox (bbox , renderer , color = 'k' , trans = None ):
1738
1735
"""
1739
1736
This is a debug function to draw a rectangle around the bounding
1740
- box returned by
1741
- :meth:`~matplotlib.artist.Artist.get_window_extent` of an artist,
1737
+ box returned by an artist's `.Artist.get_window_extent`
1742
1738
to test whether the artist is returning the correct bbox.
1743
1739
"""
1744
1740
@@ -1857,8 +1853,8 @@ def _register_style(style_list, cls=None, *, name=None):
1857
1853
1858
1854
class BoxStyle (_Style ):
1859
1855
"""
1860
- :class: `BoxStyle` is a container class which defines several
1861
- boxstyle classes, which are used for :class: `FancyBboxPatch`.
1856
+ `BoxStyle` is a container class which defines several
1857
+ boxstyle classes, which are used for `FancyBboxPatch`.
1862
1858
1863
1859
A style object can be created as::
1864
1860
@@ -2627,10 +2623,9 @@ def get_bbox(self):
2627
2623
2628
2624
class ConnectionStyle (_Style ):
2629
2625
"""
2630
- :class: `ConnectionStyle` is a container class which defines
2626
+ `ConnectionStyle` is a container class which defines
2631
2627
several connectionstyle classes, which is used to create a path
2632
- between two points. These are mainly used with
2633
- :class:`FancyArrowPatch`.
2628
+ between two points. These are mainly used with `FancyArrowPatch`.
2634
2629
2635
2630
A connectionstyle object can be either created as::
2636
2631
@@ -3071,9 +3066,9 @@ def _point_along_a_line(x0, y0, x1, y1, d):
3071
3066
3072
3067
class ArrowStyle (_Style ):
3073
3068
"""
3074
- :class: `ArrowStyle` is a container class which defines several
3069
+ `ArrowStyle` is a container class which defines several
3075
3070
arrowstyle classes, which is used to create an arrow path along a
3076
- given path. These are mainly used with :class: `FancyArrowPatch`.
3071
+ given path. These are mainly used with `FancyArrowPatch`.
3077
3072
3078
3073
A arrowstyle object can be either created as::
3079
3074
@@ -3099,7 +3094,7 @@ class ArrowStyle(_Style):
3099
3094
and it returns a tuple of a `.Path` instance and a boolean
3100
3095
value. *path* is a `.Path` instance along which the arrow
3101
3096
will be drawn. *mutation_size* and *aspect_ratio* have the same
3102
- meaning as in :class: `BoxStyle`. *linewidth* is a line width to be
3097
+ meaning as in `BoxStyle`. *linewidth* is a line width to be
3103
3098
stroked. This is meant to be used to correct the location of the
3104
3099
head so that it does not overshoot the destination point, but not all
3105
3100
classes support it.
@@ -3854,7 +3849,7 @@ def transmute(self, path, mutation_size, linewidth):
3854
3849
3855
3850
class FancyArrowPatch (Patch ):
3856
3851
"""
3857
- A fancy arrow patch. It draws an arrow using the :class: `ArrowStyle`.
3852
+ A fancy arrow patch. It draws an arrow using the `ArrowStyle`.
3858
3853
3859
3854
The head and tail positions are fixed at the specified start and end points
3860
3855
of the arrow, but the size and shape (in display coordinates) of the arrow
@@ -3906,12 +3901,11 @@ def __init__(self, posA=None, posB=None,
3906
3901
*patchB*, *shrinkA*, and *shrinkB* are ignored.
3907
3902
3908
3903
arrowstyle : str or `.ArrowStyle`, default: 'simple'
3909
- Describes how the fancy arrow will be
3910
- drawn. It can be string of the available arrowstyle names,
3911
- with optional comma-separated attributes, or an
3912
- :class:`ArrowStyle` instance. The optional attributes are meant to
3913
- be scaled with the *mutation_scale*. The following arrow styles are
3914
- available:
3904
+ The `.ArrowStyle` with which the fancy arrow is drawn. If a
3905
+ string, it should be one of the available arrowstyle names, with
3906
+ optional comma-separated attributes. The optional attributes are
3907
+ meant to be scaled with the *mutation_scale*. The following arrow
3908
+ styles are available:
3915
3909
3916
3910
%(AvailableArrowstyles)s
3917
3911
@@ -3920,19 +3914,18 @@ def __init__(self, posA=None, posB=None,
3920
3914
3921
3915
connectionstyle : str or `.ConnectionStyle` or None, optional, \
3922
3916
default: 'arc3'
3923
- Describes how *posA* and *posB* are connected. It can be an
3924
- instance of the :class:`ConnectionStyle` class or a string of the
3925
- connectionstyle name , with optional comma-separated attributes. The
3926
- following connection styles are available:
3917
+ The `.ConnectionStyle` with which *posA* and *posB* are connected.
3918
+ If a string, it should be one of the available connectionstyle
3919
+ names , with optional comma-separated attributes. The following
3920
+ connection styles are available:
3927
3921
3928
3922
%(AvailableConnectorstyles)s
3929
3923
3930
3924
connector
3931
3925
Ignored.
3932
3926
3933
3927
patchA, patchB : `.Patch`, default: None
3934
- Head and tail patch respectively. :class:`matplotlib.patch.Patch`
3935
- instance.
3928
+ Head and tail patch respectively.
3936
3929
3937
3930
shrinkA, shrinkB : float, default: 2
3938
3931
Shrinking factor of the tail and head of the arrow respectively.
@@ -4100,9 +4093,7 @@ def set_connectionstyle(self, connectionstyle, **kw):
4100
4093
self .stale = True
4101
4094
4102
4095
def get_connectionstyle (self ):
4103
- """
4104
- Return the :class:`ConnectionStyle` instance.
4105
- """
4096
+ """Return the `ConnectionStyle` used."""
4106
4097
return self ._connector
4107
4098
4108
4099
def set_arrowstyle (self , arrowstyle = None , ** kw ):
@@ -4244,10 +4235,8 @@ def draw(self, renderer):
4244
4235
4245
4236
4246
4237
class ConnectionPatch (FancyArrowPatch ):
4247
- """
4248
- A :class:`~matplotlib.patches.ConnectionPatch` class is to make
4249
- connecting lines between two points (possibly in different axes).
4250
- """
4238
+ """A patch that connects two points (possibly in different axes)."""
4239
+
4251
4240
def __str__ (self ):
4252
4241
return "ConnectionPatch((%g, %g), (%g, %g))" % \
4253
4242
(self .xy1 [0 ], self .xy1 [1 ], self .xy2 [0 ], self .xy2 [1 ])
@@ -4284,7 +4273,7 @@ def __init__(self, xyA, xyB, coordsA, coordsB=None,
4284
4273
shrinkB default is 2 points
4285
4274
mutation_scale default is text size (in points)
4286
4275
mutation_aspect default is 1.
4287
- ? any key for :class: `matplotlib.patches.PathPatch`
4276
+ ? any key for `matplotlib.patches.PathPatch`
4288
4277
=============== ======================================================
4289
4278
4290
4279
*coordsA* and *coordsB* are strings that indicate the
@@ -4314,12 +4303,10 @@ def __init__(self, xyA, xyB, coordsA, coordsB=None,
4314
4303
4315
4304
.. note::
4316
4305
4317
- Using :class:`~matplotlib.patches.ConnectionPatch` across
4318
- two :class:`~matplotlib.axes.Axes` instances is not
4319
- directly compatible with :doc:`constrained layout
4320
- </tutorials/intermediate/constrainedlayout_guide>`. Add the
4321
- artist directly to the :class:`~matplotlib.figure.Figure`
4322
- instead of adding it to a specific Axes.
4306
+ Using `ConnectionPatch` across two `~.axes.Axes` instances
4307
+ is not directly compatible with :doc:`constrained layout
4308
+ </tutorials/intermediate/constrainedlayout_guide>`. Add the artist
4309
+ directly to the `.Figure` instead of adding it to a specific Axes.
4323
4310
4324
4311
.. code-block:: default
4325
4312
0 commit comments