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

Create a temporary bitmap context if needed #4876

Merged
merged 1 commit into from Aug 8, 2015

Conversation

mdehoon
Copy link
Contributor

@mdehoon mdehoon commented Aug 7, 2015

This fixes issue #2654. Usually get_text_width_height_descent is called as part of figure.draw, and then the graphics context is available to measure the text in. If get_text_width_height_descent is called as part of tight_layout instead of figure.draw, then no graphics context is available. But since we are only measuring text and not actually drawing anything, we can create a temporary bitmap context and measure the text there.

@tacaswell tacaswell added this to the next point release milestone Aug 7, 2015
@tacaswell
Copy link
Member

Looks good to me, but I don't have a mac to test this.

attn @jenshnielsen @pelson

@dopplershift
Copy link
Contributor

Fixes it for me.

jenshnielsen added a commit that referenced this pull request Aug 8, 2015
Create a temporary bitmap context if needed
@jenshnielsen jenshnielsen merged commit 760e8b9 into matplotlib:master Aug 8, 2015
@mdehoon mdehoon deleted the fixForIssue2654 branch August 10, 2015 02:22
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

4 participants