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

Skip to content

Commit fc56ea5

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #15460: Fix incorrect value check in axes_grid.
1 parent a1f054a commit fc56ea5

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
@@ -499,7 +499,7 @@ def __init__(self, fig,
499499
if ngrids is None:
500500
ngrids = self._nrows * self._ncols
501501
else:
502-
if not 0 <= ngrids < self._nrows * self._ncols:
502+
if not 0 < ngrids <= self._nrows * self._ncols:
503503
raise Exception
504504

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

0 commit comments

Comments
 (0)