Skip to content

Fix default backend #19854

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,17 @@ def _rc_params_in_file(fname, transform=lambda x: x, fail_on_error=False):

for key, (val, line, line_no) in rc_temp.items():
if key in rcsetup._validators:
# the backend parameter is special because the default value can
# not be expressed in the matplotlibrc file (the default is an
# internal sentinel to indicated that we should do backend fallback
# which picks the first importable interactive backend we find).
#
# This allows the backend parameter to be unset (as opposed to
# not present) in the matplotlibrc file. This is important because
# the defaults are pulled from a (fully commented out) template
# including with the installation.
if key == 'backend' and val == '':
continue
if fail_on_error:
config[key] = val # try to convert to proper type or raise
else:
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/mpl-data/matplotlibrc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
## 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 'module://my_backend'.
#backend: Agg
#backend:

## The port to use for the web server in the WebAgg backend.
#webagg.port: 8988
Expand Down