如何在 seaborn 散点图中创建动画地图 [重复]

问题描述 投票:0回答:0

我有这种数据框,以便在给定时刻定位动物位置:

Lon         Lat          Time 
-66.09456   44.93958    24-02-2022 12:00:31
-66.09486   44.93928    24-02-2022 12:25:31
-66.09444   44.93944    24-02-2022 12:49:31
-66.09452   44.93947    24-02-2022 13:15:31
-66.09432   44.93922    24-02-2022 13:45:31
-66.09411   44.93986    24-02-2022 14:00:31
-66.09402   44.93948    24-02-2022 15:20:31

使用以下代码,我可以在地图上显示动物的位置,这很棒:

fig,ax=plt.subplots()
sns.scatterplot(data=Df, x='Lon', y='Lat',  hue='Time', edgecolor= 'black', linewidth=0.5, picker=True, s=17, palette=palette)
ax.set_aspect('equal')
plt.show()

如何根据动物位置和检测时间在这样的情节中创建动画?简而言之,我希望这些点根据时间一一出现在地图上。

python matplotlib seaborn matplotlib-animation
© www.soinside.com 2019 - 2024. All rights reserved.