From ea46347a1bc023210933f815b542cb379cd5cfd5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2023 17:21:35 -0400 Subject: [PATCH] Backport PR #26937: Add ArrayLike to scatter c arg type hint --- lib/matplotlib/axes/_axes.pyi | 2 +- lib/matplotlib/pyplot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.pyi b/lib/matplotlib/axes/_axes.pyi index 96ea087f7eb9..9602db3b950c 100644 --- a/lib/matplotlib/axes/_axes.pyi +++ b/lib/matplotlib/axes/_axes.pyi @@ -402,7 +402,7 @@ class Axes(_AxesBase): x: float | ArrayLike, y: float | ArrayLike, s: float | ArrayLike | None = ..., - c: Sequence[ColorType] | ColorType | None = ..., + c: ArrayLike | Sequence[ColorType] | ColorType | None = ..., marker: MarkerType | None = ..., cmap: str | Colormap | None = ..., norm: str | Normalize | None = ..., diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 00e5dea071a4..6fa7755e2c49 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -3670,7 +3670,7 @@ def scatter( x: float | ArrayLike, y: float | ArrayLike, s: float | ArrayLike | None = None, - c: Sequence[ColorType] | ColorType | None = None, + c: ArrayLike | Sequence[ColorType] | ColorType | None = None, marker: MarkerType | None = None, cmap: str | Colormap | None = None, norm: str | Normalize | None = None,