From 88737e27b672bcd97d9c85fae50f3f181b194b34 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Mon, 12 Sep 2016 10:21:11 -0700 Subject: [PATCH 1/2] 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 --- lib/matplotlib/axes/_axes.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 3d2d52b04474..0ac6fa02ba8b 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3889,17 +3889,25 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, ---------------- kwargs : `~matplotlib.collections.Collection` properties + See Also + -------- + plot : to plot scatter plots when markers are identical in size and + color + Notes - ------ - Any or all of `x`, `y`, `s`, and `c` may be masked arrays, in - which case all masks will be combined and only unmasked points - will be plotted. + ----- + + * When attempting to plot a scatter plots where markers don't vary in + size and color, the `plot` function will be faster. + + * Any or all of `x`, `y`, `s`, and `c` may be masked arrays, in which + case all masks will be combined and only unmasked points will be + plotted. - Fundamentally, scatter works with 1-D arrays; `x`, `y`, `s`, - and `c` may be input as 2-D arrays, but within scatter - they will be flattened. The exception is `c`, which - will be flattened only if its size matches the size of `x` - and `y`. + Fundamentally, scatter works with 1-D arrays; `x`, `y`, `s`, and `c` + may be input as 2-D arrays, but within scatter they will be + flattened. The exception is `c`, which will be flattened only if its + size matches the size of `x` and `y`. Examples -------- From e6e1e5626e6dc0d01ce2e682530ee463ad5b3674 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 14 Sep 2016 09:44:28 -0700 Subject: [PATCH 2/2] DOC better wording for plot vs scatter --- lib/matplotlib/axes/_axes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0ac6fa02ba8b..49a3b529ca0b 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3897,8 +3897,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, Notes ----- - * When attempting to plot a scatter plots where markers don't vary in - size and color, the `plot` function will be faster. + * The `plot` function will be faster for scatterplots where markers + don't vary in size or color. * Any or all of `x`, `y`, `s`, and `c` may be masked arrays, in which case all masks will be combined and only unmasked points will be