From d026ed24afa2815c5da17efcc01609aad2800d91 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 15 Jan 2019 17:00:24 +0100 Subject: [PATCH] Remove cairo-based backends from backend fallback. They would never be selected by the fallback machinery anyways. --- lib/matplotlib/pyplot.py | 7 +++++-- matplotlibrc.template | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 9a00f51b17da..0455ce333aed 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -190,8 +190,11 @@ def switch_backend(newbackend): close("all") if newbackend is rcsetup._auto_backend_sentinel: - for candidate in ["macosx", "qt5agg", "qt4agg", "gtk3agg", "gtk3cairo", - "tkagg", "wxagg", "agg", "cairo"]: + # 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"]: try: switch_backend(candidate) except ImportError: diff --git a/matplotlibrc.template b/matplotlibrc.template index 41592337a26c..75512da2ecb2 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -31,9 +31,10 @@ ## The default backend. If you omit this parameter, the first ## working backend from the following list is used: -## MacOSX Qt5Agg Qt4Agg Gtk3Agg GTK3Cairo TkAgg WxAgg Agg Cairo +## MacOSX Qt5Agg Qt4Agg Gtk3Agg TkAgg WxAgg Agg ## -## Other choices include: WX PS PDF SVG Template. +## Other choices include: +## Qt5Cairo Qt4Cairo GTK3Cairo TkCairo WxCairo Cairo Wx PS PDF SVG Template. ## ## You can also deploy your own backend outside of matplotlib by ## referring to the module name (which must be in the PYTHONPATH) as