What is a good, default backend for matplotlib
Both Agg
and TkAgg
do not require any dependencies beyond Python's standard library.
I have had some issues with TkAgg
and multi-threading, so if you only need to save to files (and not plt.show()
), I would recommend using Agg
instead (just replace it where TkAgg
appears below).
Either add the following line to your ~/.config/matplotlib/matplotlibrc
:
backend: TkAgg
Or the following lines to your python file:
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt