Skip to content

Patched pyplot.subplots for squeeze==False #133

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 2 commits into from
Jun 16, 2011
Merged

Patched pyplot.subplots for squeeze==False #133

merged 2 commits into from
Jun 16, 2011

Conversation

jseabold
Copy link
Contributor

@jseabold jseabold commented Jun 2, 2011

If squeeze == False, ret was never defined. I just copied over the code from 1.0.1 release.

@jseabold
Copy link
Contributor Author

jseabold commented Jun 6, 2011

For completeness this looks like the commit that introduced the bug.

d09329a

@@ -799,6 +799,9 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
ret = fig, axarr[0,0]
else:
ret = fig, axarr.squeeze()
else:
# returned axis array will be always 2-d, even if nrows=ncols=1
return fig, axarr.reshape(nrows, ncols)


return ret
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last line will now never get called so should be removed for cleanliness sake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets called if squeeze == True. The problem was that if squeeze==False, ret never gets defined. I changed 804 so that it's clearer and removed a blank line.

ddale added a commit that referenced this pull request Jun 16, 2011
Patched pyplot.subplots for squeeze==False
@ddale ddale merged commit ac02f83 into matplotlib:master Jun 16, 2011
@richbwood richbwood mentioned this pull request Dec 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants