一、fig, ax = plt.subplots()的作用?
它是用来创建 总画布/figure“窗口”的,有figure就可以在上边(或其中一个子网格/subplot上)作图了,(fig:是figure的缩写)。
plt.subplot(111)是plt.subplot(1, 1, 1)另一个写法而已
fig, ax = plt.subplots()等价于fig, ax = plt.subplots(11)
fig, axes = plt.subplots(23):即表示一次性在figure上创建成23的网格,使用plt.subplot()只能一个一个的添加[引用链接]:*
fig = plt.figure()
ax = plt.subplot(231)
ax = plt.subplot(232)
ax = plt.subplot(233)
ax = plt.subplot(234)
ax = plt.subplot(235)
ax = plt.subplot(236)
二、参数的含义?
首先看 fig = plt.figure()
matpltlib.pyplot.figure(
num = None, # 设定figure名称。系统默认按数字升序命名的figure_num(透视表输出窗口)e.g. “figure1”。可自行设定figure名称,名称或是INT,或是str类型;
figsize=None, # 设定figure尺寸。系统默认命令是rcParams["figure.fig.size"] = [6.4, 4.8]