Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

In 3.0.0 backend cannot be set if 'get_backend()' is run first #12362

Copy link
Copy link
Closed
@moonshoes87

Description

@moonshoes87
Issue body actions

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

No one assigned

    Labels

    Release criticalFor 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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.