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
Matplotlib backend should be forced to Agg #1195
Comments
@ericholscher - any idea what could be causing this? All our plots are currently broken due to this issue, which seems beyond our control and related to RTD. Are other projects not having this issue? |
We haven't changed anything that I know of. Did you try this workaround? On Tue, Mar 24, 2015 at 1:48 AM, Thomas Robitaille <notifications@github.com
Eric Holscher |
@ericholscher - yes, we already call this but we see:
which suggests that the backend has already been set beforehand. |
Any suggestions? I don't know much about matplotlib, and we haven't done On Tue, Mar 24, 2015 at 9:01 AM, Thomas Robitaille <notifications@github.com
Eric Holscher |
Maybe @mdboom has some ideas - I'm also a bit puzzled by the behavior currently. Basically I don't understand how it ever changes to use TkAgg ( |
Ah, sorry, I think I have it. Check out this minimalist project: https://github.com/astrofrog/test-rtd The RTD log (https://readthedocs.org/builds/test-rtd-astrofrog/2482239/) shows:
so the default backend is set to TkAgg. @mdboom, do you have any suggestions on how to make sure the default backend is Agg, not TkAgg, system-wide? There is no reason the TkAgg backend should ever be needed on RTD. |
Looks like there's a config in /etc/matplotlibrc that sets it. On Tue, Mar 24, 2015 at 9:14 AM, Thomas Robitaille <notifications@github.com
Eric Holscher |
@ericholscher - ah great, can you change it to |
@ericholscher - it seems to be working now, did you make the change? If so, this issue can be closed :) |
Yea, should be changed. Will keep this open because it needs to be fixed in On Tue, Mar 24, 2015 at 10:53 AM, Thomas Robitaille <
Eric Holscher |
Believe this should be fixed. |
Hello, i meet the same problem |
Hi anyone could comment how to trouble shoot this issue. how to configure /etc/matplotlibrc to solve this problem. |
Well putting these lines at the beginning of the Py code solves the purpose: |
Hi, so instead I used: that worked. maybe it's helpful to someone else. |
Hello, I am working in spyder, in @windows, and this FINALLY worked for me: Reestart spyder and then type: import matplotlib #Example of plot saved to pdf file
|
Could it be that this problem resurfaced in the Python 3.6 image? Since it get a
for a module importing matplotlib with the latest image. |
@Tillsten did you try specifying that requirement on your requirements.txt file? If you still think the problem is rtd related, please open a new issue with your rtd project link. |
Yes, I did. The problem seems to be identical to this issue: matplotlib is installed, but the default backend is set to tkagg (using tkinter), which is not available on the headless rtd-image. This problem can be fixed by changing the rc file like above or upgrading matplotlib to 3.0, which should fix that issues. |
My current workaround is just import and setting the matplotlib backend in the sphinx
|
Thanks for sharing the workaround! I'll take a look to the docker images later |
I didn't see anything else on the docker images related to this, so, not sure how this was solved (maybe rtd wasn't using the docker images in that time?). We have a workaround, so, not sure if we should reopen. Maybe adding this to the faq? |
Recently we've started to see this error appear:
when using the matplotlib plot_directive. It seems something has changed in the RTD configuration and the backend is defaulting to something interactive.
(here's the Astropy issue where someone first reported this: astropy/astropy#3600)
The text was updated successfully, but these errors were encountered: