【发布时间】:2019-02-19 16:30:23
【问题描述】:
通过msno.matrix() 为 df1 、 df2 、 df3 获取missingno 的子图的最简单方法是什么。我已经检查了this issue 和以下解决方案由于TypeError
'AxesSubplot' object does not support indexing 而没有工作,并根据that issue 更新了pandas 和missingno。
fig = msno.matrix(df)
grid_ax = fig.axes[0]
my_subplots = plt.subplots(2, 2)
my_subplots[0][0] = grid_ax
我在sn-p下面用过但是不成功。我不知道我应该怎么回复ax:
#Set up the figure
fig, ax = plt.subplots(nrows=1, ncols=2 , figsize=(8,8) , squeeze=False)
plt.subplot(131)
msno.matrix(df1)
plt.subplot(132)
msno.matrix(df2)
plt.subplot(133)
msno.matrix(df3)
plt.savefig('comparison.png')
#plt.tight_layout()
plt.show()
请留下一个通用的解决方案,我们可以通过替换不同的 df 我们可以使用它。 祝你有个愉快的夜晚
【问题讨论】:
标签: python matplotlib subplot