8000 Merge pull request #15472 from meeseeksmachine/auto-backport-of-pr-15… · QuLogic/matplotlib@d84ed49 · GitHub
[go: up one dir, main page]

Skip to content

Commit d84ed49

Browse files
authored
Merge pull request matplotlib#15472 from meeseeksmachine/auto-backport-of-pr-15460-on-v2.2.x
Backport PR matplotlib#15460 on branch v2.2.x (Fix incorrect value check in axes_grid.)
2 parents 4a52521 + 8f4bfa7 commit d84ed49

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
@@ -484,7 +484,7 @@ def __init__(self, fig,
484484
if ngrids is None:
485485
ngrids = self._nrows * self._ncols
486486
else:
487-
if not 0 <= ngrids < self._nrows * self._ncols:
487+
if not 0 < ngrids <= self._nrows * self._ncols:
488488
raise Exception
489489

490490
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
@@ -101,6 +101,7 @@ def test_axesgrid_colorbar_log_smoketest():
101101
fig = plt.figure()
102102
grid = AxesGrid(fig, 111, # modified to be only subplot
103103
nrows_ncols=(1, 1),
104+
ngrids=1,
104105
label_mode="L",
105106
cbar_location="top",
106107
cbar_mode="single",

0 commit comments

Comments
 (0)
0