Skip to content
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

subplot(x, x, 0) should raise Exception #3166

Closed
twiecki opened this issue Jun 29, 2014 · 1 comment · Fixed by #3167
Closed

subplot(x, x, 0) should raise Exception #3166

twiecki opened this issue Jun 29, 2014 · 1 comment · Fixed by #3167

Comments

@twiecki
Copy link

twiecki commented Jun 29, 2014

I'm sure I'm not the only one who used this idiom:

for i in range(4):
   plt.subplot(2, 2, i)

And got confused that the subplots show up in the wrong order. Understandbly, subplot uses 1-based indexing. But what about throwing an exception if 0 is passed, that would save a lot of wasted hours tracking down this odd behavior.

@tacaswell
Copy link
Member

As a clarification, the odd thing here is that 0 shows up last.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jun 29, 2014
if subplot(rows, cols, num) is called with num not in
0 < num <= rows * cols raise a ValueError

close matplotlib#3166
@tacaswell tacaswell added this to the v1.4.0 milestone Jun 29, 2014
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jul 6, 2014
if subplot(rows, cols, num) is called with num not in
0 < num <= rows * cols raise a ValueError

close matplotlib#3166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants