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

use GridSpec in plt.subplots #2647

Merged
merged 1 commit into from Jan 13, 2014
Merged

Conversation

rwirth
Copy link

@rwirth rwirth commented Dec 4, 2013

Use a GridSpec object to set up the subplots in plt.subplots. Add an optional parameter gridspec_kw. This enables the user to specify height_ratios and width_ratios to get grids with unequal row/column sizes while still having the convenience that subplots provides.

Use a GridSpec object to set up the subplots in plt.subplots.  Add an
optional parameter gridspec_kw.  This enables the user to specify
height_ratios and width_ratios to get grids with unequal row/column
sizes while still having the convenience that subplots provides.
@tacaswell
Copy link
Member

I like this change, but I worry about side effects.

@rwirth
Copy link
Author

rwirth commented Dec 16, 2013

I haven't done extensive testing on this, but in the simple tests I did (and in the subplots example) there was no noticeable behavior change compared to the old way. Besides, a GridSpec object is also used during the creation of the Subplot when specifying the subplot position as a Matlab-style triple (as it is done now). In the SubplotBase constructor in matplotlib/axes/_subplots.py the triples are converted into SubplotSpecs using GridSpec(rows, cols)[num - 1]. So, the explicit use of GridSpec is not doing anything fundamentally different. I will do some more testing when I find the time for it.

tacaswell added a commit that referenced this pull request Jan 13, 2014
@tacaswell tacaswell merged commit 673dbb8 into matplotlib:master Jan 13, 2014
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.

None yet

2 participants