Problem
One may get the impression that "agg" is the default backend from reading
There are three ways to configure your backend:
- The
rcParams["backend"] (default: 'agg') parameter in your matplotlibrc file
- The
MPLBACKEND environment variable
- The function
matplotlib.use()
https://matplotlib.org/stable/tutorials/introductory/usage.html#selecting-a-backend
So, not having a matplotlibrc nor MPLBACKEND, I would expect that "agg" is default. However, with DISPLAY set and an X11 server running, I get
user@host:~/cia> xeyes; echo $?; python -c "import matplotlib as mpl; print(mpl.get_backend())"
0
TkAgg
Only after closing the X11 server, everything is as expected:
user@host:~/cia> xeyes; echo $?; python -c "import matplotlib as mpl; print(mpl.get_backend())"
Error: Can't open display: localhost:12.0
1
agg
Suggested Improvement
- Explain that an interactive backend is selected by default if available.
- Make sure people find this information when searching for "TkAgg" (in case someone looks for this when trying to understand why they get what I observe).
- Remove "(default:
'agg')" from rcParams["backend"] (because it's not always correct)
Problem
One may get the impression that
"agg"is the default backend from readinghttps://matplotlib.org/stable/tutorials/introductory/usage.html#selecting-a-backend
So, not having a
matplotlibrcnorMPLBACKEND, I would expect that"agg"is default. However, withDISPLAYset and an X11 server running, I getOnly after closing the X11 server, everything is as expected:
Suggested Improvement
'agg')" fromrcParams["backend"](because it's not always correct)