9951 explained code solutions for 126 technologies


python-matplotlibHow to set white background


import matplotlib.pyplot as plt
plt.figure().patch.set_facecolor('white')
plt.axes().set_facecolor('white')
plt.plot([2,1,2,2])
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

set_facecolor

sets object background

white

set white background for both chart and general plot area

.plot(

plot specified data

.show()

render chart in a separate window