@@ -41,21 +41,19 @@ class Collection(artist.Artist, cm.ScalarMappable):
41
41
42
42
Keyword arguments and default values:
43
43
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
59
57
60
58
*offsets* and *transOffset* are used to translate the patch after
61
59
rendering (default no offsets). If offset_position is 'screen'
@@ -64,22 +62,22 @@ class Collection(artist.Artist, cm.ScalarMappable):
64
62
offset_position is 'data', the offset is applied before the master
65
63
transform, i.e., the offsets are in data coordinates.
66
64
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.
70
67
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.
75
72
"""
73
+
76
74
_offsets = np .zeros ((0 , 2 ))
77
75
_transOffset = transforms .IdentityTransform ()
78
76
#: Either a list of 3x3 arrays or an Nx3x3 array of transforms, suitable
79
77
#: for the `all_transforms` argument to
80
- #: :meth: `~matplotlib.backend_bases.RendererBase.draw_path_collection`;
78
+ #: `~matplotlib.backend_bases.RendererBase.draw_path_collection`;
81
79
#: each 3x3 array is used to initialize an
82
- #: :class: `~matplotlib.transforms.Affine2D` object.
80
+ #: `~matplotlib.transforms.Affine2D` object.
83
81
#: Each kind of collection defines this based on its arguments.
84
82
_transforms = np .empty ((0 , 3 , 3 ))
85
83
@@ -827,23 +825,20 @@ def update_from(self, other):
827
825
docstring .interpd .update (Collection = """\
828
826
Valid Collection keyword arguments:
829
827
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`)
840
836
841
837
*offsets* and *transOffset* are used to translate the patch after
842
838
rendering (default no offsets)
843
839
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.
847
842
""" )
848
843
849
844
@@ -897,14 +892,13 @@ def draw(self, renderer):
897
892
898
893
class PathCollection (_CollectionWithSizes ):
899
894
"""
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`.
902
896
"""
897
+
903
898
@docstring .dedent_interpd
904
899
def __init__ (self , paths , sizes = None , ** kwargs ):
905
900
"""
906
- *paths* is a sequence of :class:`matplotlib.path.Path`
907
- instances.
901
+ *paths* is a sequence of `matplotlib.path.Path` instances.
908
902
909
903
%(Collection)s
910
904
"""
@@ -925,7 +919,7 @@ def legend_elements(self, prop="colors", num="auto",
925
919
fmt = None , func = lambda x : x , ** kwargs ):
926
920
"""
927
921
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.::
929
923
930
924
scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3])
931
925
plt.legend(*scatter.legend_elements())
@@ -953,13 +947,13 @@ def legend_elements(self, prop="colors", num="auto",
953
947
a valid input for a `~.StrMethodFormatter`. If None (the default),
954
948
use a `~.ScalarFormatter`.
955
949
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
960
954
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`` .
963
957
kwargs : further parameters
964
958
Allowed keyword arguments are *color* and *size*. E.g. it may be
965
959
useful to set the color of the markers if *prop="sizes"* is used;
@@ -1320,8 +1314,9 @@ def __init__(self, segments, # Can be None.
1320
1314
1321
1315
Notes
1322
1316
-----
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.
1325
1320
1326
1321
If *offsets* and *transOffset* are not None, then
1327
1322
*offsets* are transformed by *transOffset* and applied after
@@ -1336,11 +1331,10 @@ def __init__(self, segments, # Can be None.
1336
1331
and this value will be added cumulatively to each successive
1337
1332
segment, so as to produce a set of successively offset curves.
1338
1333
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.
1344
1338
"""
1345
1339
if colors is None :
1346
1340
colors = mpl .rcParams ['lines.color' ]
@@ -1711,12 +1705,11 @@ def __init__(self, widths, heights, angles, units='points', **kwargs):
1711
1705
units : {'points', 'inches', 'dots', 'width', 'height', 'x', 'y', 'xy'}
1712
1706
1713
1707
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
1720
1713
``axes.transData`` as its transform.
1721
1714
1722
1715
Other Parameters
@@ -1806,14 +1799,14 @@ def __init__(self, patches, match_original=False, **kwargs):
1806
1799
providing the standard collection arguments, facecolor,
1807
1800
edgecolor, linewidths, norm or cmap.
1808
1801
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.
1812
1805
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.
1817
1810
"""
1818
1811
1819
1812
if match_original :
@@ -1906,11 +1899,11 @@ class QuadMesh(Collection):
1906
1899
"""
1907
1900
Class for the efficient drawing of a quadrilateral mesh.
1908
1901
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*
1914
1907
and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
1915
1908
(*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
1916
1909
form one of the quadrilaterals in the mesh. There are thus
@@ -1923,13 +1916,11 @@ class QuadMesh(Collection):
1923
1916
function that maps from a data point to its corresponding color,
1924
1917
use the :meth:`set_cmap` method. Each of these arrays is indexed in
1925
1918
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).
1928
1920
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.
1933
1924
1934
1925
*shading* may be 'flat', or 'gouraud'
1935
1926
"""
0 commit comments