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