Skip to content

Create a temporary bitmap context if needed#4876

Merged
jenshnielsen merged 1 commit into
matplotlib:masterfrom
mdehoon:fixForIssue2654
Aug 8, 2015
Merged

Create a temporary bitmap context if needed#4876
jenshnielsen merged 1 commit into
matplotlib:masterfrom
mdehoon:fixForIssue2654

Conversation

@mdehoon

@mdehoon mdehoon commented Aug 7, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

attn @jenshnielsen @pelson

@dopplershift

Copy link
Copy Markdown
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.

4 participants