【发布时间】:2017-11-03 15:06:41
【问题描述】:
python 3.6 om mac matplotlib 2.1.0 使用 matplotlib.pyplot(作为 plt)
假设我有几个plt.figures(),我将它们附加到一个称为图形的列表中作为对象。当我在命令行中时:figures[0]it 为列表figures 的索引 0 生成图。
但是,我如何安排将图中的所有图都放在子图中。
# Pseudo code:
plt.figure()
for i, fig in enumerate(figures): # figures contains the plots
plt.subplot(2, 2, i+1)
fig # location i+1 of the subplot is filled with the fig plot element
因此,我将创建一个 2 x 2 的网格,其中包含图中找到的每个图。
希望这是有道理的。
【问题讨论】:
标签: python-3.x matplotlib plot