You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pandas, we have this matplotlib code calling Figure.colorbar which is triggering the colormesh deprecation:
Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
And calling ax.grid(False) does not address the deprecation
diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py
index ee7493813f..69c749e84b 100644
--- a/pandas/plotting/_matplotlib/core.py
+++ b/pandas/plotting/_matplotlib/core.py
@@ -1172,6 +1172,7 @@ class PlanePlot(MPLPlot, ABC):
# GH33389, if ax is used multiple times, we should always
# use the last one which contains the latest information
# about the ax
+ ax.grid(False)
img = ax.collections[-1]
return self.fig.colorbar(img, ax=ax, **kwds)
Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
Please provide a minimal executable (pandas) example that displays the behavior.
It seems that for some reason the colorbar axes got a grid, which is a bit unusual. We need the example to see how you are setting up the figure and be able to trace what is happening.
Activity
timhoffm commentedon Aug 14, 2022
Please provide a minimal executable (pandas) example that displays the behavior.
It seems that for some reason the colorbar axes got a grid, which is a bit unusual. We need the example to see how you are setting up the figure and be able to trace what is happening.
Internal note: The warning is triggered via
matplotlib/lib/matplotlib/colorbar.py
Line 577 in a68f21f
oscargus commentedon Aug 14, 2022
I believe that this was fixed in #22216 and will be in 3.6.0.
Most likely you have a style that sets the grid to be
True.oscargus commentedon Aug 30, 2022
@mroeschke can you please try with the 3.6 rc and see if this is still an issue?
mroeschke commentedon Aug 30, 2022
Sorry for the delay in responding. I just tested this with the 3.6.0rc and the warning disappeared (without any code changes). Thanks for the help!