函数:
figure(num=None, figsize=None, dpi=None, facecolor=None, edgecolor=None, frameon=True, FigureClass=Figure, clear=False, **kwargs)
num
: integer or string, optional, default: none,num:如果此参数没有提供,则一个新的figure对象将被创建,同时增加figure的计数数值,此数值被保存在figure对象的一个数字属性当中。如果有此参数,且存在对应id的figure对象,则激活对于id的figure对象。如果对应id的figur对象不存在,则创建它并返回它。如果num的值是字符串,则将窗口标题设置为此字符串。figsize
: tuple of integers, optional, default: None
width, height in inches. If not provided, defaults to rc figure.figsize
figsize:以英寸为单位的宽高,缺省值为 rc figure.figsize (1英寸等于2.54厘米)dpi
: integer, optional, default: None dpi:图形分辨率,缺省值为rc figure.dpifacecolor
:
the background color. If not provided, defaults to rc figure.facecolo
facecolor:背景色plt.figure(num="6*2 inches", figsize=(6, 2),facecolor="gray") plt.show()
edgecolor
:
the border color. If not provided, defaults to rc figure.edgecolor
edgecolor:边框颜色clear
: bool, optional, default: False
If True and the figure already exists, then it is cleared
clear:重建figure实例