matplotlib.figure.Figure结构及用法

  • 解析

matplotlib绘图工具包

figure其中一个子模块,共定义了三个类AxesStackFigureSubplotParams 。就是呈现图片的那个窗口。

Figure:matplotlib.figure下的一个类。

  • Figure类

class matplotlib.figure.Figure(figsize=None, dpi=None, facecolor=None, edgecolor=None, linewidth=0.0, frameon=None, subplotpars=None, tight_layout=None, constrained_layout=None)

The top level container for all the plot elements.

有两个属性:patch、suppressComposite

九个参数:

  • dpi 像素

  • figsize 尺寸

  • facecolor 图像颜色

  • edgecolor 边框颜色

  • linewidth 边框线宽

  • Figure.functions()相关函数

  1. Figure.add_subplot(111)

subplot的意思是子画,就是在同一个Figure上绘制多张子图。
Figure.add_subplot()与pyplot.subplot()是一个意思。
这些是作为单个整数编码的子绘图网格参数。例如,“111”表示“1×1网格,第一子图”,“234”表示“2×3网格,第四子图”。网格顺序为:从左到右从上到下。
add_subplot(111)的替代形式是add_subplot(1,1,1)。

  • Reference

  1. python – 在Matplotlib中,参数在fig.add_subplot(111)中是什么意思?

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/89292835