【发布时间】:2021-05-26 07:24:31
【问题描述】:
在 matplotlib.pyplot 中使用命令中的子图时,有没有办法给图形编号? 当我想在图中有一个情节时,我可以使用
import matplotlib.pyplot as plt
plt.figure(2)
plot(x,y)
这将创建图 2 并在其中绘制图。但是,使用子图时我不能这样做
plt.figure(3)
f, ax = plt.subplots(1,2)
ax[0].plot(x,y)
这基本上显示了一个新的图 3,然后是另一个图 4,其中包含子图。我想给有子图的那个编号。
提前致谢。
【问题讨论】:
标签: python matplotlib plot subplot figure