From 5b108bc88bb5eb53a93e04613d56eade3f2c3970 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:11:17 -0800 Subject: [PATCH] COMPAT: Fix the last warning from matplotlib 3.5.0 (#44544) --- pandas/plotting/_matplotlib/core.py | 1 - pandas/tests/plotting/common.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 08dc9538227f7..ba47391513ed2 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -1036,7 +1036,6 @@ def _plot_colorbar(self, ax: Axes, **kwds): # use the last one which contains the latest information # about the ax img = ax.collections[-1] - ax.grid(False) cbar = self.fig.colorbar(img, ax=ax, **kwds) if mpl_ge_3_0_0(): diff --git a/pandas/tests/plotting/common.py b/pandas/tests/plotting/common.py index 52127b926f1fa..ae9db5e728efe 100644 --- a/pandas/tests/plotting/common.py +++ b/pandas/tests/plotting/common.py @@ -552,7 +552,7 @@ def is_grid_on(): obj.plot(kind=kind, grid=False, **kws) assert not is_grid_on() - if kind != "pie": + if kind not in ["pie", "hexbin", "scatter"]: self.plt.subplot(1, 4 * len(kinds), spndx) spndx += 1 mpl.rc("axes", grid=True)