本篇的目的在于把语法集中在一起,便于自己操作
没有翻译成汉语的原因在于:想锻炼英文写作和表达能力
汉语更方便的使用者可参考:https://blog.csdn.net/m0_37362454/article/details/81511427
一:语法
参考官网:https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html
- matplotlib.pyplot.figure(num=None, figsize=None, dpi=None, facecolor=None, edgecolor=None, frameon=True, FigureClass=<class ‘matplotlib.figure.Figure’>, clear=False, **kwargs)
parameters:
num int or str or Figure, optional
figsize(float, float), default: rcParams["figure.figsize"] (default: [6.4, 4.8])
Width, height in inches.
dpifloat, default: rcParams["figure.dpi"] (default: 100.0)
The resolution of the figure in dots-per-inch.
facecolorcolor, default: rcParams["figure.facecolor"] (default: 'white')
The background color.
edgecolorcolor, default: rcParams["figure.edgecolor"] (default: 'white')
The border color.
frameonbool, default: True
If False, suppress drawing the figure frame.
FigureClasssubclass of Figure
Optionally use a custom Figure instance.
二:实际操作命令
- import matplotlib.pyplot as plt