From 1a1a4457ada788eb9ceb7cd0abe7026c0b716f1c Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 30 Aug 2022 10:16:22 -0700 Subject: [PATCH] TST: Filter false positive matplotlib warning --- pandas/plotting/_matplotlib/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 0b6e5b346062a..7a469f9f19d80 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -1177,7 +1177,11 @@ def _plot_colorbar(self, ax: Axes, **kwds): # use the last one which contains the latest information # about the ax img = ax.collections[-1] - return self.fig.colorbar(img, ax=ax, **kwds) + with warnings.catch_warnings(): + # https://github.com/matplotlib/matplotlib/issues/23614 + # False positive deprecation warning until matplotlib=3.6 + warnings.filterwarnings("ignore", "Auto-removal of grids") + return self.fig.colorbar(img, ax=ax, **kwds) class ScatterPlot(PlanePlot):