8000 Backport PR #14279 on branch v3.1.x (In case fallback to Agg fails, let the exception propagate out.) by meeseeksmachine · Pull Request #14284 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #14279 on branch v3.1.x (In case fallback to Agg fails, let the exception propagate out.) #14284

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,21 @@ def switch_backend(newbackend):
# Don't try to fallback on the cairo-based backends as they each have
# an additional dependency (pycairo) over the agg-based backend, and
# are of worse quality.
for candidate in ["macosx", "qt5agg", "qt4agg", "gtk3agg", "tkagg",
"wxagg", "agg"]:
for candidate in [
686A "macosx", "qt5agg", "qt4agg", "gtk3agg", "tkagg", "wxagg"]:
try:
switch_backend(candidate)
except ImportError:
continue
else:
rcParamsOrig['backend'] = candidate
return
else:
# Switching to Agg should always succeed; if it doesn't, let the
# exception propagate out.
switch_backend("agg")
rcParamsOrig["backend"] = "agg"
return

backend_name = (
newbackend[9:] if newbackend.startswith("module://")
Expand Down
0