Skip to content

Commit 41be134

Browse files
authored
Merge pull request #15470 from meeseeksmachine/auto-backport-of-pr-15460-on-v3.1.x
Backport PR #15460 on branch v3.1.x (Fix incorrect value check in axes_grid.)
2 parents bfa7339 + d907d75 commit 41be134

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def __init__(self, fig,
491491
if ngrids is None:
492492
ngrids = self._nrows * self._ncols
493493
else:
494-
if not 0 <= ngrids < self._nrows * self._ncols:
494+
if not 0 < ngrids <= self._nrows * self._ncols:
495495
raise Exception
496496

497497
self.ngrids = ngrids

lib/mpl_toolkits/tests/test_axes_grid1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def test_axesgrid_colorbar_log_smoketest():
105105
fig = plt.figure()
106106
grid = AxesGrid(fig, 111, # modified to be only subplot
107107
nrows_ncols=(1, 1),
108+
ngrids=1,
108109
label_mode="L",
109110
cbar_location="top",
110111
cbar_mode="single",

0 commit comments

Comments
 (0)