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):