Can someone please explain why the code below does not work when setting the facecolor of the figure?
import matplotlib.pyplot as plt # create figure instan
savefig has its own parameter for facecolor. I think an even easier way than the accepted answer is to set them globally just once, instead of putting facecolor=fig.get_facecolor() every time:
savefig
facecolor
facecolor=fig.get_facecolor()
plt.rcParams['axes.facecolor']='red' plt.rcParams['savefig.facecolor']='red'