-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
tight_layout : automatic adjustment of subplot params #124
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
Conversation
From reading the docs (haven't read the code yet), I'm wondering if there isn't a way around the final limitation (about colorbars). Why does the layout code only work on Subplot subclasses, and not all Axes subclasses? |
@@ -888,7 +888,7 @@ class Axis(artist.Artist): | |||
for tick in zip(*group): | |||
yield tick | |||
|
|||
def get_ticklabel_extents(self, renderer): | |||
def get_ticklabel_extents_old(self, renderer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good reason to keep this around? It looks like the new version is mainly just a refactoring into get_ticklabel_extents and _get_tick_bboxes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I meant to remove it when refactoring is done. And I just removed it. Thanks.
The reason that it only supports subplots is because it is easy. In general, I don't think we can figure out the intention of the users when they specified the positions of axes. If you (or others) have any idea or suggestions, let me know. |
I see. That makes sense. It still would be nice to handle colorbars in a more intuitive way if possible. (Of course, I have no bright ideas right now...) |
plt.show() | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples should probably also be included as regression tests.
I added tests for tight_layout. |
Ah yes. I'm seeing a lot of failures as well. I should hopefully have some time to look into this tomorrow. |
See #129 for a fix to most of the regression tests. |
--- This is a patch motivated by Tony Yus work (http://www.mail-archive.com/[email protected]/msg18107.html). The basic idea is same while implemented slight differently. * no drawing is necessary * support subplots that span multiple rows/columns I also worked on simple guide that demonstrate its functionality (tight_layout_guide.rst). The html copy is here (any help with the documentation will be appreciated). http://dl.dropbox.com/u/178748/Tight%20Layout%20guide%20%E2%80%94%20Matplotlib%20v1.1.0%20documentation.html
This is a patch motivated by Tony Yu's work (http://www.mail-archive.com/[email protected]/msg18107.html). The basic idea is same while implemented slight differently.
I also worked on simple guide that demonstrate its functionality (tight_layout_guide.rst). The html copy is here (any help with the documentation will be appreciated).
http://dl.dropbox.com/u/178748/Tight%20Layout%20guide%20%E2%80%94%20Matplotlib%20v1.1.0%20documentation.html