From 6064a2e6f6d46c4639d93b0b81f932435be67c44 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 8 Mar 2023 17:53:07 -0500 Subject: [PATCH 1/3] DOC: add a note about linewidth to scatter docs closes #25410 Co-authored-by: Elliott Sales de Andrade --- lib/matplotlib/axes/_axes.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 5354d8fd79f2..7e743ea727b2 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4478,6 +4478,20 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, The marker size in points**2 (typographic points are 1/72 in.). Default is ``rcParams['lines.markersize'] ** 2``. + The linewidth and edgecolor can visually interact with the marker + size. + + If the linewidth is greater than 0 and the edegecolor is anything + but *'none'*, then the effective size of the marker will be + increased by half the linewidth as the stroke drawn for the edge + will be centered on the edge of the shape. + + If the marker size is smaller than the linewidth there will be + visual artifacts. + + To eliminate the marker edge either set *linewidth=0* or + *edgecolor='none'*. + c : array-like or list of colors or color, optional The marker colors. Possible values: From 732ec3ac662e17d1b6e67bd130f920080d09dc5f Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 31 Mar 2023 16:17:08 -0400 Subject: [PATCH 2/3] DOC: improve wording Co-authored-by: Jody Klymak --- lib/matplotlib/axes/_axes.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 7e743ea727b2..f45af88e9e27 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4479,15 +4479,13 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, Default is ``rcParams['lines.markersize'] ** 2``. The linewidth and edgecolor can visually interact with the marker - size. + size, and can lead to artifacts if the marker size is smaller than + the linewidth. If the linewidth is greater than 0 and the edegecolor is anything but *'none'*, then the effective size of the marker will be - increased by half the linewidth as the stroke drawn for the edge - will be centered on the edge of the shape. - - If the marker size is smaller than the linewidth there will be - visual artifacts. + increased by half the linewidth because the stroke will be centered + on the edge of the shape. To eliminate the marker edge either set *linewidth=0* or *edgecolor='none'*. From cb058e2619488c50a66204029706d7a1d21748e9 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 31 Mar 2023 17:57:32 -0400 Subject: [PATCH 3/3] DOC: fix spelling Co-authored-by: Kyle Sunden --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f45af88e9e27..29718a1d97d6 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4482,7 +4482,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, size, and can lead to artifacts if the marker size is smaller than the linewidth. - If the linewidth is greater than 0 and the edegecolor is anything + If the linewidth is greater than 0 and the edgecolor is anything but *'none'*, then the effective size of the marker will be increased by half the linewidth because the stroke will be centered on the edge of the shape.