From c24d2211e05d811ab99e13e5f4450864adb87686 Mon Sep 17 00:00:00 2001 From: Rayan Salhab Date: Thu, 18 Jun 2026 04:55:30 +0300 Subject: [PATCH] Backport PR #31898: fix: allow array-like fill_between where masks --- lib/matplotlib/axes/_axes.pyi | 4 ++-- lib/matplotlib/pyplot.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes/_axes.pyi b/lib/matplotlib/axes/_axes.pyi index b43ad157f6b5..1ec52655676f 100644 --- a/lib/matplotlib/axes/_axes.pyi +++ b/lib/matplotlib/axes/_axes.pyi @@ -479,7 +479,7 @@ class Axes(_AxesBase): x: ArrayLike, y1: ArrayLike | float, y2: ArrayLike | float = ..., - where: Sequence[bool] | None = ..., + where: ArrayLike | None = ..., interpolate: bool = ..., step: Literal["pre", "post", "mid"] | None = ..., *, @@ -491,7 +491,7 @@ class Axes(_AxesBase): y: ArrayLike, x1: ArrayLike | float, x2: ArrayLike | float = ..., - where: Sequence[bool] | None = ..., + where: ArrayLike | None = ..., step: Literal["pre", "post", "mid"] | None = ..., interpolate: bool = ..., *, diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 732ec874bf38..97fd1bc6209e 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -3497,7 +3497,7 @@ def fill_between( x: ArrayLike, y1: ArrayLike | float, y2: ArrayLike | float = 0, - where: Sequence[bool] | None = None, + where: ArrayLike | None = None, interpolate: bool = False, step: Literal["pre", "post", "mid"] | None = None, *, @@ -3522,7 +3522,7 @@ def fill_betweenx( y: ArrayLike, x1: ArrayLike | float, x2: ArrayLike | float = 0, - where: Sequence[bool] | None = None, + where: ArrayLike | None = None, step: Literal["pre", "post", "mid"] | None = None, interpolate: bool = False, *,