2
嗨即時試圖使從數據顫抖情節的動畫在我的數據幀動畫箭袋情節熊貓數據幀
我有存儲這樣的熊貓數據幀的數據,有點像這個
QuivXLoc QuivYLoc QuivXVal QuivYVal QuivColorVal QuivPlotNum
0 -70.22 -127.241 1.624 -0.879 1.846623 1
1 -61.74 -127.241 -0.973 -0.027 0.973375 1
2 -65.98 -121.835 0.046 2.416 2.416438 1
3 -74.46 -121.835 -0.151 2.673 2.677262 1
4 -78.70 -116.429 1.073 -0.954 1.435773 2
我目前正在這樣繪製它,並且它完美地爲每個序列號生成單獨的圖。
for seq in quidf['QuivPlotNum'].unique():
temp=quidf[quidf['QuivPlotNum']==seq] ## make subset to plot
plt.quiver(temp['QuivXLoc'], temp['QuivYLoc'], temp['QuivXVal'], temp['QuivYVal'], # data
temp['QuivColorVal'], # colour the arrows based on this array
cmap=cm.jet, # colour map
headlength=3) # length of the arrows
Theres一些額外的代碼來格式化我忽略的情節。
我想要做的是根據迭代我的數據框中的序號對動畫序列進行動畫處理。我所看到的所有針對Quiver Animation的例子都涉及通過增加一些標量來縮放前一個函數。類似顫動的動畫
比如我想生成,我都試過,但無法弄清楚如何改變update_quiver爲我的應用程序工作: Plotting animated quivers in Python
你的意思是將動畫箭頭箭頭增長到最終長度?你有什麼嘗試? – barny
是的,在這個例子中,動畫顯示顫抖情節是按照幀改變的。但它是基於標量更新的。我想根據存儲在DataFrame中的數據進行繪圖.http://stackoverflow.com/questions/19329039/plotting-animated-quivers-in-python –