Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d634609

Browse files
jklymakmeeseeksmachine
authored andcommitted
Backport PR #22285: Don't warn on grid removal deprecation if grid is hidden
1 parent d31670f commit d634609

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5617,8 +5617,11 @@ def _interp_grid(X):
56175617
return X, Y, C, shading
56185618

56195619
def _pcolor_grid_deprecation_helper(self):
5620-
if any(axis._major_tick_kw["gridOn"]
5621-
for axis in self._get_axis_list()):
5620+
grid_active = any(axis._major_tick_kw["gridOn"]
5621+
for axis in self._get_axis_list())
5622+
# explicit is-True check because get_axisbelow() can also be 'line'
5623+
grid_hidden_by_pcolor = self.get_axisbelow() is True
5624+
if grid_active and not grid_hidden_by_pcolor:
56225625
_api.warn_deprecated(
56235626
"3.5", message="Auto-removal of grids by pcolor() and "
56245627
"pcolormesh() is deprecated since %(since)s and will be "

0 commit comments

Comments
 (0)