A scatter plot of *y* vs. *x* with varying marker size and/or color. Parameters ---------- x, y : float or array-like, shape (n, ) The data positions. s : float or array-like, shape (n, ), optional The marker size in points**2 (typog
(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
vmin=None, vmax=None, alpha=None, linewidths=None, *,
edgecolors=None, colorizer=None, plotnonfinite=False, **kwargs)
| 5179 | label_namer="y") |
| 5180 | @_docstring.interpd |
| 5181 | def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, |
| 5182 | vmin=None, vmax=None, alpha=None, linewidths=None, *, |
| 5183 | edgecolors=None, colorizer=None, plotnonfinite=False, **kwargs): |
| 5184 | """ |
| 5185 | A scatter plot of *y* vs. *x* with varying marker size and/or color. |
| 5186 | |
| 5187 | Parameters |
| 5188 | ---------- |
| 5189 | x, y : float or array-like, shape (n, ) |
| 5190 | The data positions. |
| 5191 | |
| 5192 | s : float or array-like, shape (n, ), optional |
| 5193 | The marker size in points**2 (typographic points are 1/72 in.). |
| 5194 | Default is ``rcParams['lines.markersize'] ** 2``. |
| 5195 | |
| 5196 | The linewidth and edgecolor can visually interact with the marker |
| 5197 | size, and can lead to artifacts if the marker size is smaller than |
| 5198 | the linewidth. |
| 5199 | |
| 5200 | If the linewidth is greater than 0 and the edgecolor is anything |
| 5201 | but *'none'*, then the effective size of the marker will be |
| 5202 | increased by half the linewidth because the stroke will be centered |
| 5203 | on the edge of the shape. |
| 5204 | |
| 5205 | To eliminate the marker edge either set *linewidth=0* or |
| 5206 | *edgecolor='none'*. |
| 5207 | |
| 5208 | c : array-like or list of :mpltype:`color` or :mpltype:`color`, optional |
| 5209 | The marker colors. Possible values: |
| 5210 | |
| 5211 | - A scalar or sequence of n numbers to be mapped to colors using |
| 5212 | *cmap* and *norm*. |
| 5213 | - A 2D array in which the rows are RGB or RGBA. |
| 5214 | - A sequence of colors of length n. |
| 5215 | - A single color format string. |
| 5216 | |
| 5217 | Note that *c* should not be a single numeric RGB or RGBA sequence |
| 5218 | because that is indistinguishable from an array of values to be |
| 5219 | colormapped. If you want to specify the same RGB or RGBA value for |
| 5220 | all points, use a 2D array with a single row. Otherwise, |
| 5221 | value-matching will have precedence in case of a size matching with |
| 5222 | *x* and *y*. |
| 5223 | |
| 5224 | If you wish to specify a single color for all points |
| 5225 | prefer the *color* keyword argument. |
| 5226 | |
| 5227 | Defaults to `None`. In that case the marker color is determined |
| 5228 | by the value of *color*, *facecolor* or *facecolors*. In case |
| 5229 | those are not specified or `None`, the marker color is determined |
| 5230 | by the next color of the ``Axes``' current "shape and fill" color |
| 5231 | cycle. This cycle defaults to :rc:`axes.prop_cycle`. |
| 5232 | |
| 5233 | marker : `~.markers.MarkerStyle`, default: :rc:`scatter.marker` |
| 5234 | The marker style. *marker* can be either an instance of the class |
| 5235 | or the text shorthand for a particular marker. |
| 5236 | See :mod:`matplotlib.markers` for more information about marker |
| 5237 | styles. |
| 5238 |