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

Problem with backend qt4agg #85

Open
RolandBacon opened this issue Aug 6, 2019 · 3 comments
Open

Problem with backend qt4agg #85

RolandBacon opened this issue Aug 6, 2019 · 3 comments

Comments

@RolandBacon
Copy link

I have a piece of code working fine with TkAgg backend. I have now move to qt4agg in order to use my plot within pyqt5.
The code now crash in get_renderer
File "/Users/rolandbacon/Dropbox/Soft/python/mpdaf/lib/mpdaf/sdetect/catalog.py", line 1189, in plot_symb
expand_points=(expand, expand))
File "/Users/rolandbacon/miniconda3/lib/python3.7/site-packages/adjustText/init.py", line 425, in adjust_text
r = get_renderer(ax.get_figure())
File "/Users/rolandbacon/miniconda3/lib/python3.7/site-packages/adjustText/init.py", line 39, in get_renderer
return fig.canvas.renderer

builtins.AttributeError: 'NoneType' object has no attribute 'renderer'

@Phlya
Copy link
Owner

Phlya commented Aug 6, 2019

Thanks for reporting. I am really busy at the moment, but it would really help to fix this if you could figure out how to get the renderer for qt4agg backend... Annoyingly, it can vary between backends, and I have already merged a PR to fix this for MacOS renderer, but I guess qt4agg is different from the default and from MacOS too.
#15

@RolandBacon
Copy link
Author

I found a few link which may be useful there, but no idea how this could be implemented. Hope this will be useful.
Thanks in advance for your help

matplotlib/matplotlib#1852

https://sourceforge.net/p/matplotlib/mailman/matplotlib-devel/?viewmonth=201007&viewday=22

Is a backend required to implement a get_renderer method? I only see it implemented in backend_agg.py, and it's missing in backend_bases.py, backend_template.py, backend_cairo.py, and in the macosx backend. If you want to try your code with the macosx backend, you can use fig.canvas.renderer instead of fig.canvas.get_renderer().

@Phlya
Copy link
Owner

Phlya commented Aug 7, 2019

Ugh, thanks, this is really annoying, thanks for digging though!

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

No branches or pull requests

2 participants