From 235c6bebc9860fa8cedf527743e0143ec16fdf03 Mon Sep 17 00:00:00 2001 From: saiteja Date: Tue, 24 Mar 2026 08:31:17 +0530 Subject: [PATCH 1/2] Enable path simplification for FillBetweenPolyCollection to reduce vector output size --- lib/matplotlib/collections.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 27b3789a3105..5d13363c6988 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -1444,6 +1444,13 @@ def __init__( verts = self._make_verts(t, f1, f2, where) super().__init__(verts, **kwargs) + def set_verts(self, verts, closed=True): + super().set_verts(verts, closed=closed) + for path in self._paths: + path.should_simplify = True + + set_paths = set_verts + @staticmethod def _f_dir_from_t(t_direction): """The direction that is other than `t_direction`.""" From b730263d124dada9319bd69f12cc91d8426f2bcd Mon Sep 17 00:00:00 2001 From: saiteja Date: Tue, 24 Mar 2026 11:08:22 +0530 Subject: [PATCH 2/2] Respect rcParams when enabling path simplification for FillBetweenPolyCollection --- lib/matplotlib/collections.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 5d13363c6988..e968a0771598 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -1446,8 +1446,11 @@ def __init__( def set_verts(self, verts, closed=True): super().set_verts(verts, closed=closed) + + # Respect global path simplification setting + simplify = bool(mpl.rcParams.get("path.simplify", True)) for path in self._paths: - path.should_simplify = True + path.should_simplify = simplify set_paths = set_verts