图形对象figure

Posted gengyi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了图形对象figure相关的知识,希望对你有一定的参考价值。

创建图形Creates a new figure

1 语法

plt.figure(num=None, 
           figsize=None,
           dpi=None,
           facecolor=None,
           edgecolor=None,
           frameon=True,
           FigureClass=<class matplotlib.figure.Figure>,
           clear=False,
           **kwargs
)

参数:

num - 整数或字符串,optional。默认值None,

         若无,则创建一个新图形,图形编号(数字)递增,同时将数字保存在number属性中;

         若提供了num值,系统首先检测该num值(整数或字符串)是否存在,存在则将其设置为活动状态,同时返回对他的应用,若不存在,创建图形并返回它

         但是,数字和字符串不同,数字为编号(不会显示在图形中,其内部的编号),字符串为图形名称

figsize - tuple of integers , 指定figure的宽和高,单位为英寸 ,若无提供,defaults to rc figure.figsize.

dpi - 图形的分辨率,int,optinal,若缺省,则defaults to rc figure.dpi.

faceclor - 背景色,若缺省,则 defaults to rc figure.facecolor.

edgecolor - 边框颜色,若缺省,则 defaults to rc figure.edgecolor.

frameon - 布尔值bool,optional ,默认True(绘制边框),若False,则不绘制边框

clear - 布尔值bool,optional,默认False,若True,且该图已存在,则会将其清除并重新绘制

FigureClass - matplotlib.figure.Figure的派生类,optional,使用自定义图形实例

 

以上是关于图形对象figure的主要内容,如果未能解决你的问题,请参考以下文章

matlab 有关figure图 中箭头怎么画

matlab中的“gcf”是啥意思?

matlab的figure怎么导出txt

MATLAB绘图—设置特定的坐标刻度

线条图

matplotlib.pyplot 导引