8000 Update markup for collections docstrings. · matplotlib/matplotlib@07d0b6a · GitHub
[go: up one dir, main page]

Skip to content

Commit 07d0b6a

Browse files
committed
Update markup for collections docstrings.
1 parent 95c8c88 commit 07d0b6a

File tree

1 file changed

+70
-79
lines changed

1 file changed

+70
-79
lines changed

lib/matplotlib/collections.py

Lines changed: 70 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,19 @@ class Collection(artist.Artist, cm.ScalarMappable):
4141
4242
Keyword arguments and default values:
4343
44-
* *edgecolors*: None
45-
* *facecolors*: None
46-
* *linewidths*: None
47-
* *capstyle*: None
48-
* *joinstyle*: None
49-
* *antialiaseds*: None
50-
* *offsets*: None
51-
* *transOffset*: transforms.IdentityTransform()
52-
* *offset_position*: 'screen' (default) or 'data'
53-
* *norm*: None (optional for
54-
:class:`matplotlib.cm.ScalarMappable`)
55-
* *cmap*: None (optional for
56-
:class:`matplotlib.cm.ScalarMappable`)
57-
* *hatch*: None
58-
* *zorder*: 1
44+
- *edgecolors*: None
45+
- *facecolors*: None
46+
- *linewidths*: None
47+
- *capstyle*: None
48+
- *joinstyle*: None
49+
- *antialiaseds*: None
50+
- *offsets*: None
51+
- *transOffset*: transforms.IdentityTransform()
52+
- *offset_position*: 'screen' (default) or 'data'
53+
- *norm*: None (optional for `matplotlib.cm.ScalarMappable`)
54+
- *cmap*: None (optional for `matplotlib.cm.ScalarMappable`)
55+
- *hatch*: None
56+
- *zorder*: 1
5957
6058
*offsets* and *transOffset* are used to translate the patch after
6159
rendering (default no offsets). If offset_position is 'screen'
@@ -64,22 +62,22 @@ class Collection(artist.Artist, cm.ScalarMappable):
6462
offset_position is 'data', the offset is applied before the master
6563
transform, i.e., the offsets are in data coordinates.
6664
67-
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds*
68-
are None, they default to their :data:`matplotlib.rcParams` patch
69-
setting, in sequence form.
65+
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds* are
66+
None, they default to their `.rcParams` patch setting, in sequence form.
7067
71-
The use of :class:`~matplotlib.cm.ScalarMappable` is optional. If
72-
the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not None
73-
(i.e., a call to set_array has been made), at draw time a call to
74-
scalar mappable will be made to set the face colors.
68+
The use of `~matplotlib.cm.ScalarMappable` functionality is optional. If
69+
the `~matplotlib.cm.ScalarMappable` matrix ``_A`` has been set (via a call
70+
to `~.ScalarMappable.set_array`), at draw time a call to scalar mappable
71+
will be made to set the face colors.
7572
"""
73+
7674
_offsets = np.zeros((0, 2))
7775
_transOffset = transforms.IdentityTransform()
7876
#: Either a list of 3x3 arrays or an Nx3x3 array of transforms, suitable
7977
#: for the `all_transforms` argument to
80-
#: :meth:`~matplotlib.backend_bases.RendererBase.draw_path_collection`;
78+
#: `~matplotlib.backend_bases.RendererBase.draw_path_collection`;
8179
#: each 3x3 array is used to initialize an
82-
#: :class:`~matplotlib.transforms.Affine2D` object.
80+
#: `~matplotlib.transforms.Affine2D` object.
8381
#: Each kind of collection defines this based on its arguments.
8482
_transforms = np.empty((0, 3, 3))
8583

@@ -827,23 +825,20 @@ def update_from(self, other):
827825
docstring.interpd.update(Collection="""\
828826
Valid Collection keyword arguments:
829827
830-
* *edgecolors*: None
831-
* *facecolors*: None
832-
* *linewidths*: None
833-
* *antialiaseds*: None
834-
* *offsets*: None
835-
* *transOffset*: transforms.IdentityTransform()
836-
* *norm*: None (optional for
837-
:class:`matplotlib.cm.ScalarMappable`)
838-
* *cmap*: None (optional for
839-
:class:`matplotlib.cm.ScalarMappable`)
828+
- *edgecolors*: None
829+
- *facecolors*: None
830+
- *linewidths*: None
831+
- *antialiaseds*: None
832+
- *offsets*: None
833+
- *transOffset*: transforms.IdentityTransform()
834+
- *norm*: None (optional for `matplotlib.cm.ScalarMappable`)
835+
- *cmap*: None (optional for `matplotlib.cm.ScalarMappable`)
840836
841837
*offsets* and *transOffset* are used to translate the patch after
842838
rendering (default no offsets)
843839
844-
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds*
845-
are None, they default to their :data:`matplotlib.rcParams` patch
846-
setting, in sequence form.
840+
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds* are
841+
None, they default to their `.rcParams` patch setting, in sequence form.
847842
""")
848843

849844

@@ -897,14 +892,13 @@ def draw(self, renderer):
897892

898893
class PathCollection(_CollectionWithSizes):
899894
"""
900-
This is the most basic :class:`Collection` subclass.
901-
A :class:`PathCollection` is e.g. created by a :meth:`~.Axes.scatter` plot.
895+
The most basic `Collection` subclass, created e.g. by `~.Axes.scatter`.
902896
"""
897+
903898
@docstring.dedent_interpd
904899
def __init__(self, paths, sizes=None, **kwargs):
905900
"""
906-
*paths* is a sequence of :class:`matplotlib.path.Path`
907-
instances.
901+
*paths* is a sequence of `matplotlib.path.Path` instances.
908902
909903
%(Collection)s
910904
"""
@@ -925,7 +919,7 @@ def legend_elements(self, prop="colors", num="auto",
925919
fmt=None, func=lambda x: x, **kwargs):
926920
"""
927921
Creates legend handles and labels for a PathCollection. This is useful
928-
for obtaining a legend for a :meth:`~.Axes.scatter` plot. E.g.::
922+
for obtaining a legend for a `~.Axes.scatter` plot. E.g.::
929923
930924
scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3])
931925
plt.legend(*scatter.legend_elements())
@@ -953,13 +947,13 @@ def legend_elements(self, prop="colors", num="auto",
953947
a valid input for a `~.StrMethodFormatter`. If None (the default),
954948
use a `~.ScalarFormatter`.
955949
func : function, default *lambda x: x*
956-
Function to calculate the labels. Often the size (or color)
957-
argument to :meth:`~.Axes.scatter` will have been pre-processed
958-
by the user using a function *s = f(x)* to make the markers
959-
visible; e.g. *size = np.log10(x)*. Providing the inverse of this
950+
Function to calculate the labels. Often the size (or color)
951+
argument to `~.Axes.scatter` will have been pre-processed by the
952+
user using a function ``s = f(x)`` to make the markers visible;
953+
e.g. ``size = np.log10(x)``. Providing the inverse of this
960954
function here allows that pre-processing to be inverted, so that
961-
the legend labels have the correct values;
962-
e.g. *func = np.exp(x, 10)*.
955+
the legend labels have the correct values; e.g. ``func = lambda
956+
x: 10**x``.
963957
kwargs : further parameters
964958
Allowed keyword arguments are *color* and *size*. E.g. it may be
965959
useful to set the color of the markers if *prop="sizes"* is used;
@@ -1320,8 +1314,9 @@ def __init__(self, segments, # Can be None.
13201314
13211315
Notes
13221316
-----
1323-
If *linewidths*, *colors*, or *antialiaseds* is None, they
1324-
default to their rcParams setting, in sequence form.
1317+
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds* are
1318+
None, they default to their `.rcParams` patch setting, in sequence
1319+
form.
13251320
13261321
If *offsets* and *transOffset* are not None, then
13271322
*offsets* are transformed by *transOffset* and applied after
@@ -1336,11 +1331,10 @@ def __init__(self, segments, # Can be None.
13361331
and this value will be added cumulatively to each successive
13371332
segment, so as to produce a set of successively offset curves.
13381333
1339-
The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
1340-
If the :class:`~matplotlib.cm.ScalarMappable` array
1341-
:attr:`~matplotlib.cm.ScalarMappable._A` is not None (i.e., a call to
1342-
:meth:`~matplotlib.cm.ScalarMappable.set_array` has been made), at
1343-
draw time a call to scalar mappable will be made to set the colors.
1334+
The use of `~matplotlib.cm.ScalarMappable` functionality is optional.
1335+
If the `~matplotlib.cm.ScalarMappable` matrix ``_A`` has been set (via
1336+
a call to `~.ScalarMappable.set_array`), at draw time a call to scalar
1337+
mappable will be made to set the face colors.
13441338
"""
13451339
if colors is None:
13461340
colors = mpl.rcParams['lines.color']
@@ -1711,12 +1705,11 @@ def __init__(self, widths, heights, angles, units='points', **kwargs):
17111705
units : {'points', 'inches', 'dots', 'width', 'height', 'x', 'y', 'xy'}
17121706
17131707
The units in which majors and minors are given; 'width' and
1714-
'height' refer to the dimensions of the axes, while 'x'
1715-
and 'y' refer to the *offsets* data units. 'xy' differs
1716-
from all others in that the angle as plotted varies with
1717-
the aspect ratio, and equals the specified angle only when
1718-
the aspect ratio is unity. Hence it behaves the same as
1719-
the :class:`~matplotlib.patches.Ellipse` with
1708+
'height' refer to the dimensions of the axes, while 'x' and 'y'
1709+
refer to the *offsets* data units. 'xy' differs from all others in
1710+
that the angle as plotted varies with the aspect ratio, and equals
1711+
the specified angle only when the aspect ratio is unity. Hence
1712+
it behaves the same as the `~matplotlib.patches.Ellipse` with
17201713
``axes.transData`` as its transform.
17211714
17221715
Other Parameters
@@ -1806,14 +1799,14 @@ def __init__(self, patches, match_original=False, **kwargs):
18061799
providing the standard collection arguments, facecolor,
18071800
edgecolor, linewidths, norm or cmap.
18081801
1809-
If any of *edgecolors*, *facecolors*, *linewidths*,
1810-
*antialiaseds* are None, they default to their
1811-
:data:`matplotlib.rcParams` patch setting, in sequence form.
1802+
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds* are
1803+
None, they default to their `.rcParams` patch setting, in sequence
1804+
form.
18121805
1813-
The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
1814-
If the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not
1815-
None (i.e., a call to set_array has been made), at draw time a
1816-
call to scalar mappable will be made to set the face colors.
1806+
The use of `~matplotlib.cm.ScalarMappable` functionality is optional.
1807+
If the `~matplotlib.cm.ScalarMappable` matrix ``_A`` has been set (via
1808+
a call to `~.ScalarMappable.set_array`), at draw time a call to scalar
1809+
mappable will be made to set the face colors.
18171810
"""
18181811

18191812
if match_original:
@@ -1906,11 +1899,11 @@ class QuadMesh(Collection):
19061899
"""
19071900
Class for the efficient drawing of a quadrilateral mesh.
19081901
1909-
A quadrilateral mesh consists of a grid of vertices. The
1910-
dimensions of this array are (*meshWidth* + 1, *meshHeight* +
1911-
1). Each vertex in the mesh has a different set of "mesh
1912-
coordinates" representing its position in the topology of the
1913-
mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
1902+
A quadrilateral mesh consists of a grid of vertices.
1903+
The dimensions of this array are (*meshWidth* + 1, *meshHeight* + 1).
1904+
Each vertex in the mesh has a different set of "mesh coordinates"
1905+
representing its position in the topology of the mesh.
1906+
For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
19141907
and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
19151908
(*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
19161909
form one of the quadrilaterals in the mesh. There are thus
@@ -1923,13 +1916,11 @@ class QuadMesh(Collection):
19231916
function that maps from a data point to its corresponding color,
19241917
use the :meth:`set_cmap` method. Each of these arrays is indexed in
19251918
row-major order by the mesh coordinates of the vertex (or the mesh
1926-
coordinates of the lower left vertex, in the case of the
1927-
colors).
1919+
coordinates of the lower left vertex, in the case of the colors).
19281920
1929-
For example, the first entry in *coordinates* is the
1930-
coordinates of the vertex at mesh coordinates (0, 0), then the one
1931-
at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
1932-
so on.
1921+
For example, the first entry in *coordinates* is the coordinates of the
1922+
vertex at mesh coordinates (0, 0), then the one at (0, 1), then at (0, 2)
1923+
.. (0, meshWidth), (1, 0), (1, 1), and so on.
19331924
19341925
*shading* may be 'flat', or 'gouraud'
19351926
"""

0 commit comments

Comments
 (0)
0