@@ -3951,74 +3951,75 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
3951
3951
verts = None , edgecolors = None ,
3952
3952
** kwargs ):
3953
3953
"""
3954
- Make a scatter plot of *x* vs *y*.
3955
-
3956
- Marker size is scaled by *s* and marker color is mapped to *c*.
3954
+ A scatter plot of *y* vs *x* with varying marker size *s* and/or
3955
+ color *c*.
3957
3956
3958
3957
Parameters
3959
3958
----------
3960
3959
x, y : array_like, shape (n, )
3961
- Input data
3960
+ The data positions.
3962
3961
3963
3962
s : scalar or array_like, shape (n, ), optional
3964
- Size in points**2.
3963
+ The marker size in points**2.
3965
3964
Default is ``rcParams['lines.markersize'] ** 2``.
3966
3965
3967
3966
c : color, sequence, or sequence of color, optional, default: 'b'
3968
- *c* can be a single color format string, or a sequence of color
3969
- specifications of length `N`, or a sequence of `N` numbers to be
3970
- mapped to colors using the `cmap` and `norm` specified via kwargs
3971
- (see below). Note that `c` should not be a single numeric RGB or
3972
- RGBA sequence because that is indistinguishable from an array of
3973
- values to be colormapped. `c` can be a 2-D array in which the
3974
- rows are RGB or RGBA, however, including the case of a single
3975
- row to specify the same color for all points.
3967
+ The marker color. Possible values:
3968
+
3969
+ - A single color format string.
3970
+ - A sequence of color specifications of length n.
3971
+ - A sequence of n numbers to be mapped to colors using *cmap* and
3972
+ *norm*.
3973
+ - A 2-D array in which the rows are RGB or RGBA.
3974
+
3975
+ Note that *c* should not be a single numeric RGB or RGBA sequence
3976
+ because that is indistinguishable from an array of values to be
3977
+ colormapped. If you want to specify the same RGB or RGBA value for
3978
+ all points, use a 2-D array with a single row.
3976
3979
3977
3980
marker : `~matplotlib.markers.MarkerStyle`, optional, default: 'o'
3978
- See `~matplotlib.markers` for more information on the different
3979
- styles of markers scatter supports. *marker* can be either
3980
- an instance of the class or the text shorthand for a particular
3981
- marker.
3981
+ The marker style. *marker* can be either an instance of the class
3982
+ or the text shorthand for a particular marker.
3983
+ See `~matplotlib.markers` for more information marker styles.
3982
3984
3983
3985
cmap : `~matplotlib.colors.Colormap`, optional, default: None
3984
- A `~matplotlib.colors. Colormap` instance or registered name.
3985
- *cmap* is only used if *c* is an array of floats. If ``None``,
3986
- defaults to rc ``image.cmap``.
3986
+ A `. Colormap` instance or registered colormap name. *cmap* is only
3987
+ used if *c* is an array of floats. If ``None``, defaults to rc
3988
+ ``image.cmap``.
3987
3989
3988
3990
norm : `~matplotlib.colors.Normalize`, optional, default: None
3989
- A `~matplotlib.colors. Normalize` instance is used to scale
3990
- luminance data to 0, 1. *norm* is only used if *c* is an array of
3991
- floats. If ``None``, use the default `.colors.Normalize`.
3991
+ A `~. Normalize` instance is used to scale luminance data to 0, 1.
3992
+ *norm* is only used if *c* is an array of floats. If *None*, use
3993
+ the default `.colors.Normalize`.
3992
3994
3993
3995
vmin, vmax : scalar, optional, default: None
3994
3996
*vmin* and *vmax* are used in conjunction with *norm* to normalize
3995
- luminance data. If either are `` None`` , the min and max of the
3996
- color array is used. Note if you pass a *norm* instance, your
3997
- settings for *vmin* and *vmax* will be ignored .
3997
+ luminance data. If None, the respective min and max of the color
3998
+ array is used. *vmin* and *vmax* are ignored if you pass a *norm*
3999
+ instance .
3998
4000
3999
4001
alpha : scalar, optional, default: None
4000
- The alpha blending value, between 0 (transparent) and 1 (opaque)
4002
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
4001
4003
4002
4004
linewidths : scalar or array_like, optional, default: None
4003
- If ``None``, defaults to ``(lines.linewidth,)``.
4005
+ The linewidth of the marker edges. Note: The default *edgecolors*
4006
+ is 'face'. You may want to change this as well.
4007
+ If *None*, defaults to rcParams ``lines.linewidth``.
4004
4008
4005
4009
verts : sequence of (x, y), optional
4006
- If *marker* is ``None``, these vertices will be used to
4007
- construct the marker. The center of the marker is located
4008
- at (0,0) in normalized units. The overall marker is rescaled
4009
- by *s*.
4010
-
4011
- edgecolors : color or sequence of color, optional, default: None
4012
- If ``None``, defaults to 'face'.
4010
+ If *marker* is *None*, these vertices will be used to construct
4011
+ the marker. The center of the marker is located at (0, 0) in
4012
+ normalized units. The overall marker is rescaled by *s*.
4013
4013
4014
- If 'face', the edge color will always be the same as
4015
- the face color.
4014
+ edgecolors : color or sequence of color, optional, default: 'face'
4015
+ The edge color of the marker. Possible values:
4016
4016
4017
- If 'none', the patch boundary will not
4018
- be drawn.
4017
+ - 'face': The edge color will always be the same as the face color.
4018
+ - 'none': No patch boundary will be drawn.
4019
+ - A matplotib color.
4019
4020
4020
- For non-filled markers, the *edgecolors* kwarg
4021
- is ignored and forced to 'face' internally.
4021
+ For non-filled markers, the *edgecolors* kwarg is ignored and
4022
+ forced to 'face' internally.
4022
4023
4023
4024
Returns
4024
4025
-------
@@ -4036,14 +4037,14 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4036
4037
Notes
4037
4038
-----
4038
4039
4039
- * The `plot` function will be faster for scatterplots where markers
4040
+ * The `. plot` function will be faster for scatterplots where markers
4040
4041
don't vary in size or color.
4041
4042
4042
4043
* Any or all of *x*, *y*, *s*, and *c* may be masked arrays, in which
4043
4044
case all masks will be combined and only unmasked points will be
4044
4045
plotted.
4045
4046
4046
- Fundamentally, scatter works with 1-D arrays; *x*, *y*, *s*, and *c*
4047
+ * Fundamentally, scatter works with 1-D arrays; *x*, *y*, *s*, and *c*
4047
4048
may be input as 2-D arrays, but within scatter they will be
4048
4049
flattened. The exception is *c*, which will be flattened only if its
4049
4050
size matches the size of *x* and *y*.
0 commit comments