Closed
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
import matplotlib
if not matplotlib.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:
Metadata
Metadata
Assignees
Labels
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.