From 0ff06009554c949f44b196e29dcb99e1a3c5290f Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:53:18 +0100 Subject: [PATCH] MNT: Warn on using pixel marker for scatter() Improves on #11460. --- lib/matplotlib/axes/_axes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f03de3236c8d..c5bac26a28d6 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4938,6 +4938,12 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, marker_obj = marker else: marker_obj = mmarkers.MarkerStyle(marker) + if cbook._str_equal(marker_obj.get_marker(), ","): + _api.warn_external( + "The pixel maker ',' is not supported on scatter(). Fallback " + "to a finite-sized square, which is not necessarily 1 pixel in " + "size. Use the square marker 's' instead to suppress this warning." + ) path = marker_obj.get_path().transformed( marker_obj.get_transform())