You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EB sets MPLBACKEND to Agg by default to give a non-interactive backend.
Whilst this solves the problem of "why won't my matplotlib work in the batch system" [1], it leads to the trickier problem of "how to get matplotlib to be interactive when I want to use it interactively?" [2].
According to the Slack discussion, matplotlib/matplotlib#17396 pulled in a improved matplotlib backend fallback since v3.3.3.
Is this something that could be changed?
Thomas
[1] one for which people are often accustomed and have good workarounds
[2] My personal approach to support EB's matplotlib now looks something like this. I'm sure there's a better way, but I don't know what it is.
from os import environ
import matplotlib
if 'DISPLAY' not in environ:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
else:
import matplotlib.pyplot as plt
if not matplotlib.is_interactive():
plt.switch_backend(matplotlib.rcsetup._auto_backend_sentinel)
The text was updated successfully, but these errors were encountered:
EB sets
MPLBACKEND
toAgg
by default to give a non-interactive backend.Whilst this solves the problem of "why won't my matplotlib work in the batch system" [1], it leads to the trickier problem of "how to get matplotlib to be interactive when I want to use it interactively?" [2].
According to the Slack discussion, matplotlib/matplotlib#17396 pulled in a improved matplotlib backend fallback since v3.3.3.
Is this something that could be changed?
[1] one for which people are often accustomed and have good workarounds
[2] My personal approach to support EB's matplotlib now looks something like this. I'm sure there's a better way, but I don't know what it is.
The text was updated successfully, but these errors were encountered: