FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

colorbar optionally uses GridSpecFromSubplotSpec to create cax by leejjoon · Pull Request #126 · matplotlib/matplotlib · GitHub

Repository navigation

colorbar optionally uses GridSpecFromSubplotSpec to create cax - #126

Merged
leejjoon merged 2 commits into
matplotlib:masterfrom
leejjoon:colorbar_gridspec
Jun 9, 2011
Merged

leejjoon merged 2 commits into
matplotlib:masterfrom
leejjoon:colorbar_gridspec

Conversation

Copy link
Copy Markdown
Contributor

When pyplot.colorbar is called (w/ cax=None), it modifies the position of the parent axes and creates a new axes (cax) for a colorbar. However, issues can arise if the parent axes is an instance of Subplot because cax is created as an instance of Axes.

This patch introduces a new keyword parameter "use_gridspec". If True (default is False) and if the parent axes is an instance of Subplot, cax is created also as an instance of Subplot.

This patch is partly motivated to support tight_layout. Since cax is a subplot, tight_layout works.

Comment thread lib/matplotlib/colorbar.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I assume you didn't intend to leave this print statement in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That is now fixed with 02fbdbc. Thanks.

leejjoon added a commit that referenced this pull request Jun 9, 2011
---

When pyplot.colorbar is called (w/ cax=None), it modifies the position of the parent axes and creates a new axes (cax) for a colorbar. However, issues can arise if the parent axes is an instance of Subplot because cax is created as an instance of Axes.

This patch introduces a new keyword parameter "use_gridspec". If True (default is False) and if the parent axes is an instance of Subplot, cax is created also as an instance of Subplot.

This patch is partly motivated to support tight_layout. Since cax is a subplot, tight_layout works.
leejjoon merged commit 02fbdbc into matplotlib:master Jun 9, 2011
richbwood mentioned this pull request Dec 19, 2012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL