From 72240900ca440493ba5129ad0993199c9db1ccfd Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 3 Aug 2025 11:25:46 +0200 Subject: [PATCH] MNT: Remove explicit use of default value add_collection(..., autolim=True) --- lib/matplotlib/axes/_axes.py | 6 +++--- lib/matplotlib/tests/test_collections.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index b71f26b76d38..f0bc139bdc11 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3043,7 +3043,7 @@ def broken_barh(self, xranges, yrange, align="bottom", **kwargs): vertices.append([(x0, y0), (x0, y1), (x1, y1), (x1, y0)]) col = mcoll.PolyCollection(np.array(vertices), **kwargs) - self.add_collection(col, autolim=True) + self.add_collection(col) return col @@ -5821,7 +5821,7 @@ def quiver(self, *args, **kwargs): # Make sure units are handled for x and y values args = self._quiver_units(args, kwargs) q = mquiver.Quiver(self, *args, **kwargs) - self.add_collection(q, autolim=True) + self.add_collection(q) return q # args can be some combination of X, Y, U, V, C and all should be replaced @@ -5832,7 +5832,7 @@ def barbs(self, *args, **kwargs): # Make sure units are handled for x and y values args = self._quiver_units(args, kwargs) b = mquiver.Barbs(self, *args, **kwargs) - self.add_collection(b, autolim=True) + self.add_collection(b) return b # Uses a custom implementation of data-kwarg handling in diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py index e6e36da29aa8..c062e8c12b9c 100644 --- a/lib/matplotlib/tests/test_collections.py +++ b/lib/matplotlib/tests/test_collections.py @@ -524,7 +524,7 @@ def test_regularpolycollection_rotate(): col = mcollections.RegularPolyCollection( 4, sizes=(100,), rotation=alpha, offsets=[xy], offset_transform=ax.transData) - ax.add_collection(col, autolim=True) + ax.add_collection(col) @image_comparison(['regularpolycollection_scale.png'], remove_text=True) @@ -552,7 +552,7 @@ def get_transform(self): circle_areas = [np.pi / 2] squares = SquareCollection( sizes=circle_areas, offsets=xy, offset_transform=ax.transData) - ax.add_collection(squares, autolim=True) + ax.add_collection(squares) ax.axis([-1, 1, -1, 1])