I am making a scatter plot in matplotlib and need to change the background of the actual plot to black. I know how to change the face color of the plot using:
fig = plt.figure()
fig.patch.set_facecolor('xkcd:mint green')
My issue is that this changes the color of the space around the plot. How to I change the actual background color of the plot?
ax.patch.set_facecolor('black')
(whereax
is the axes instance).fig.patch
is the figure background andax.patch
is the axes background. – Joe Kington