Skip to content

Fix incorrect value check in axes_grid. #15460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axes_grid1/axes_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def __init__(self, fig,
if ngrids is None:
ngrids = self._nrows * self._ncols
else:
if not 0 <= ngrids < self._nrows * self._ncols:
if not 0 < ngrids <= self._nrows * self._ncols:
raise Exception

self.ngrids = ngrids
Expand Down
1 change: 1 addition & 0 deletions lib/mpl_toolkits/tests/test_axes_grid1.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def test_axesgrid_colorbar_log_smoketest(legacy_colorbar):
fig = plt.figure()
grid = AxesGrid(fig, 111, # modified to be only subplot
nrows_ncols=(1, 1),
ngrids=1,
label_mode="L",
cbar_location="top",
cbar_mode="single",
Expand Down