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

Make matplotlib.use() report where the backend was set first, in case of conflict #7287

Closed
anntzer opened this issue Oct 16, 2016 · 1 comment
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Oct 16, 2016

Currently, calling matplotlib.use(...) when a (different) backend is already set results in the warning

/usr/lib/python3.5/site-packages/matplotlib/__init__.py:1391: UserWarning:  This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

It would be helpful for debugging purposes if this also reported where the backend was set for the first time. This could be done, e.g., by saving the traceback (in text form) whenever matplotlib.backends is imported for the first time, and display that traceback in the later warning (perhaps only if the verbose flag is set).

@anntzer
Copy link
Contributor Author

anntzer commented Oct 28, 2016

Closed by #7303.

@anntzer anntzer closed this as completed Oct 28, 2016
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Oct 28, 2016
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