from matplotlib.animation import FuncAnimation fig, ax = plt.subplots(figsize=(5,4)) def update(frame): ax.clear() slices = gdf[gdf['minute'] == frame] if not slices.empty: slices.plot(ax=ax, color='blue', marker='o', markersize=30, alpha=0.6) ax.set_title(f"Time: {frame}", fontsize=14) ax.set_xlim(gdf.total_bounds[[0,2]]) ax.set_ylim(gdf.total_bounds[[1,3]]) ax.set_axis_off() anim = FuncAnimation(fig, update, frames=minute_slices, repeat=False) from IPython.display import HTML html_output = anim.to_html5_video() plt.close() HTML(html_output)