#fig.set_facecolor((1,0,0)) 设置坐标轴的颜色,其中r、g、b取[0,1]之间的浮点数。
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 100)
fig = plt.figure(figsize=(8,6),dpi=80)
fig.set_facecolor((1,0,0))
ax1 = fig.add_subplot(2,2,1)
ax1.plot(x, x)
ax1.legend(['y=x'])
ax2 = fig.add_subplot(2,2,2)
ax2.plot(x, -x,'r') ;
ax2.legend(['y=-x'])
ax3 = fig.add_subplot(2,2,3)
ax3.plot(x, x ** 2,'b')
ax3.legend(['y=x*x'])
ax4 = fig.add_subplot(2,2,4)
ax4.plot(x, np.log(x),'g')
ax4.legend(['y=log(x)'],loc='lower right')
plt.show()