使用matplotlib更改背景*而不使用*框架

ali*_*oar 4 python matplotlib

鉴于此代码,

from pylab import *
ion()
axes(frameon = 0, aspect = 1, polar = 1)
grid (True)
Run Code Online (Sandbox Code Playgroud)

我得到了包含轴的窗口,我可以在那里绘制我需要的东西.

我想将此窗口的背景从标准灰色更改为另一种颜色.

我不想使用框架.

sod*_*odd 8

facecolor调用时需要指定参数的参数figure():

from pylab import *
ion()
figure(facecolor='white') # Or any other color
axes(frameon = 0, aspect = 1, polar = 1)
grid(True)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述