def reset_matplotlib(): """ Reset matplotlib to a common default. """ # Set all default values. mpl.rcdefaults() # Force agg backend. plt.switch_backend('agg')