2948 explained code solutions for 75 technologies


python-matplotlibHow to set background transparency


import matplotlib.pyplot as plt

p = plt.figure().patch
p.set_facecolor('orange')
p.set_alpha(0.5)

ax = plt.axes()
ax.patch.set_facecolor('red')
ax.patch.set_alpha(0.25)

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

set_alpha

set object background transparency

plt.figure()

object to manipulate general area

plt.axes()

object to manipulate chart

.plot(

plot specified data

.show()

render chart in a separate window