【发布时间】:2018-07-25 04:20:29
【问题描述】:
我正在尝试遍历 Pandas 数据框中的一些数据并绘制到不同的子图中,但不太确定我做错了什么。
代码如下:
df2 = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
fig, axes = plt.subplots(nrows=4, ncols=1, sharex=True)
for i, col in enumerate(df2.columns):
print(col)
axes[i] = df2[col].plot(kind="box")
如何填满其他子图?
【问题讨论】:
-
df2[col].plot(kind="box", ax = axes[I])?
标签: python pandas matplotlib subplot