Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f7da452

Browse files
authored
Merge pull request #13189 from anntzer/no-cairo-fallback
Remove cairo-based backends from backend fallback.
2 parents b1e6ac6 + d026ed2 commit f7da452

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/matplotlib/pyplot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,11 @@ def switch_backend(newbackend):
190190
close("all")
191191

192192
if newbackend is rcsetup._auto_backend_sentinel:
193-
for candidate in ["macosx", "qt5agg", "qt4agg", "gtk3agg", "gtk3cairo",
194-
"tkagg", "wxagg", "agg", "cairo"]:
193+
# Don't try to fallback on the cairo-based backends as they each have
194+
# an additional dependency (pycairo) over the agg-based backend, and
195+
# are of worse quality.
196+
for candidate in ["macosx", "qt5agg", "qt4agg", "gtk3agg", "tkagg",
197+
"wxagg", "agg"]:
195198
try:
196199
switch_backend(candidate)
197200
except ImportError:

matplotlibrc.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131

3232
## The default backend. If you omit this parameter, the first
3333
## working backend from the following list is used:
34-
## MacOSX Qt5Agg Qt4Agg Gtk3Agg GTK3Cairo TkAgg WxAgg Agg Cairo
34+
## MacOSX Qt5Agg Qt4Agg Gtk3Agg TkAgg WxAgg Agg
3535
##
36-
## Other choices include: WX PS PDF SVG Template.
36+
## Other choices include:
37+
## Qt5Cairo Qt4Cairo GTK3Cairo TkCairo WxCairo Cairo Wx PS PDF SVG Template.
3738
##
3839
## You can also deploy your own backend outside of matplotlib by
3940
## referring to the module name (which must be in the PYTHONPATH) as

0 commit comments

Comments
 (0)