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
Document that the matplotlib backend will be set to Agg #153
Comments
Makes sense. I am wondering whether it would not be possible to raise an error inside sphinx-gallery if the matplotlib backend has already been set to something else that Agg. |
Given that switching backends is rather poorly supported by matplotlib, that probably makes sense. |
I prepared PR #157. It will issue a warning instead of raising an error. |
btw, matplotlib/matplotlib#7303 was merged into matplotlib recently, so that may or may not be enough by itself. |
While trying to use sphinx-gallery to document my mplcursors (https://mplcursors.readthedocs.io/en/stable/) package, I got the following (well-known) warning:
Turns out that in my
conf.py
, I already importmplcursors/__init__.py
(in order to get the version set byversioneer
out of it), and that this triggers an import ofmatplotlib.pyplot
(which I can actually get rid of, but that's irrelevant here). A simple solution was simply to set the backend toAgg
before importingmplcursors
.Documenting this point could perhaps save some head-scratching for others too.
The text was updated successfully, but these errors were encountered: