Skip to content

Update tight_layout.py #6484

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

Closed
wants to merge 1 commit into from
Closed

Update tight_layout.py #6484

wants to merge 1 commit into from

Conversation

SPike666
Copy link

Fixed warning when using tight_layout in calling get renderer on mac os x

Fixed warning when using tight_layout in calling get renderer
@tacaswell
Copy link
Member

@mdboom is this still a thing with the new osx backend?

@tacaswell tacaswell added this to the 2.0 (style change major release) milestone May 26, 2016
@tacaswell
Copy link
Member

@SPike666 Can you provide any more context for this change? What warning were you getting?

@SPike666
Copy link
Author

@tacaswell I was working with biosppy python module (toolbox for biosignal processing, https://github.com/PIA-Group/BioSPPy) which uses matplotlib to visualise processed data.
On calling ecg.ecg(data, sample_rate, draw=True) function, matplotlib was throwing warning in tight_layout.get_renderer function (UserWarning: tight_layout : falling back to Agg renderer
warnings.warn("tight_layout : falling back to Agg renderer"))
which was caused by canvas that had no attribute/method "get_renderer". I've set breakpoint and saw that canvas has "renderer" attribute - added elif statement and it worked fine.
All the code after that warning wasn't executed but there were no exceptions - maybe the module handled it. It was performed on Macbook Pro with OS X El Capitan v.10.11.4 with Python 2.7.10

@jenshnielsen
Copy link
Member

As far as I know this has been fixed on 2.x as part of #6178 see 142d9fc

@tacaswell
Copy link
Member

Closing this as on 2.x/master the macosx backend does have a get_renderer method. That would be the preferred solution (making the macosx backend compliant with everything else rather than adding a special case for it).

@SPike666 Please ping to have this re-opened if you are still getting these warnings using either 2.x or master.

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