Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88737e2

Browse files
committed
DOC refer to plot in the scatter plot doc
Encourage users to use plot instead of scatter when all markers are identical in size and colour. Closes #7083
1 parent 4f559a9 commit 88737e2

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3889,17 +3889,25 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38893889
----------------
38903890
kwargs : `~matplotlib.collections.Collection` properties
38913891
3892+
See Also
3893+
--------
3894+
plot : to plot scatter plots when markers are identical in size and
3895+
color
3896+
38923897
Notes
3893-
------
3894-
Any or all of `x`, `y`, `s`, and `c` may be masked arrays, in
3895-
which case all masks will be combined and only unmasked points
3896-
will be plotted.
3898+
-----
3899+
3900+
* When attempting to plot a scatter plots where markers don't vary in
3901+
size and color, the `plot` function will be faster.
3902+
3903+
* Any or all of `x`, `y`, `s`, and `c` may be masked arrays, in which
3904+
case all masks will be combined and only unmasked points will be
3905+
plotted.
38973906
3898-
Fundamentally, scatter works with 1-D arrays; `x`, `y`, `s`,
3899-
and `c` may be input as 2-D arrays, but within scatter
3900-
they will be flattened. The exception is `c`, which
3901-
will be flattened only if its size matches the size of `x`
3902-
and `y`.
3907+
Fundamentally, scatter works with 1-D arrays; `x`, `y`, `s`, and `c`
3908+
may be input as 2-D arrays, but within scatter they will be
3909+
flattened. The exception is `c`, which will be flattened only if its
3910+
size matches the size of `x` and `y`.
39033911
39043912
Examples
39053913
--------

0 commit comments

Comments
 (0)