Using plotly.express to create scatterplot_mapbox, map displays but animation does not work
I am creating a map with scatterplot_mapbox, I can create a map with my desired points plotted. However, animation does not work (buttons appear but do not function). I have run the exact same code in a jupyter notebook and the animation works. Any tips on getting the animation working?
Code:
fig = px.scatter_mapbox(plot_data, lat='lat', lon='lon', #z='Magnitude',
center=dict(lat=start_lat, lon=start_lon), zoom=1,
width = 1200, height = 600,
animation_frame='datetime',
mapbox_style="open-street-map",
# category_orders={
# 'Date':list(plot_data['datetime'])
# },
text = 'm',
color = 'm',
)
#fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
#fig.show()
solara.FigurePlotly(fig)
Thank you for reading.
1 Reply
Well, I discovered a fix - replace solara.FigurePlotly(fig) with solara.display(fig). Animation works now.