Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug report
Bug summary
In my code, I need to check whether the matplotlib backend has already been set. If it has not been set, I need to then set it to 'WXAgg'. In matplotlib 2.*, I was able to do this, but in matplotlib 3.0.0 it fails.
Code for reproduction
importmatplotlibifnotmatplotlib.get_backend()=='WXAgg':matplotlib.use('WXAgg')print('backend:',matplotlib.get_backend())
Actual outcome
With matplotlib 3.0.0:
/Users/nebula/Python/PmagPy/programs/test.py:7: UserWarning: matplotlib.pyplot as already been /Users/nebula/Python/PmagPy/programs/test.py:7: UserWarning: matplotlib.pyplot as already been imported, this call will have no effect. matplotlib.use('WXAgg')backend: MacOSX
Expected outcome
With matplotlib 2.2.3:
backend: WXAgg
Matplotlib version
- Operating system: OSX High Sierra 10.13.6
- Matplotlib version: 3.0.0
- Matplotlib backend (
print(matplotlib.get_backend())
): - Python version: 3.6.6 (Anaconda, default channel)
- Jupyter version (if applicable):
- Other libraries: