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

Skip to content

Commit a6da11e

Browse files
authored
Merge pull request #22285 from timhoffm/grid-removal-deprecation
Don't warn on grid removal deprecation if grid is hidden
2 parents a0af7cc + 9e6d723 commit a6da11e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/axes/_axes.py

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

56265626
def _pcolor_grid_deprecation_helper(self):
5627-
if any(axis._major_tick_kw["gridOn"]
5628-
for axis in self._get_axis_list()):
5627+
grid_active = any(axis._major_tick_kw["gridOn"]
5628+
for axis in self._get_axis_list())
5629+
# explicit is-True check because get_axisbelow() can also be 'line'
5630+
grid_hidden_by_pcolor = self.get_axisbelow() is True
5631+
if grid_active and not grid_hidden_by_pcolor:
56295632
_api.warn_deprecated(
56305633
"3.5", message="Auto-removal of grids by pcolor() and "
56315634
"pcolormesh() is deprecated since %(since)s and will be "

0 commit comments

Comments
 (0)