在Jupyter

时间:2017-07-22 21:25:13

标签: python pandas matplotlib plot jupyter

在Jupyter笔记本中):我想循环遍历Pandas Groupby对象中的组,并在同一轴上绘制其GPS坐标。首先,我想每次都清除这个数字,并按组分别绘制数据。在第二种情况下,我希望他们积累而不是被清除。

问题1:不幸的是,在下面的代码中,轴每次迭代都会改变。有人知道如何保持轴的固定吗?

问题2:如何保持vs清除迭代?

这是我的入门代码:

fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlabel('LON'); ax.set_ylabel('LAT')
ax.set_xlim(50, 100); ax.set_ylim(0 ,30)
plt.ion()

fig.show()
fig.canvas.draw()

for key, data in groups:
    ax.clear()
    ax.scatter(data.LON, data.LAT)

0 个答案:

没有答案