I want to use Scattergl to create animated Plotly graphs. I actively work with regular Scatter, as well as with Scatter3d - no problems.
I have a problem with Scattergl - all subsequent frames are not displayed.
I’ve added a small minimally reproducible example of my problem. If you change Scattergl to Scatter, then everything works fine. What am I doing wrong?
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scattergl(x=[4, 2, 56, 3, 1], y=[2, 35, 2, 12, 5], mode="markers"))
frames = [
go.Frame(name=0, data=go.Scattergl(x=[12, 4, 1, 6, 5], y=[4, 2, 5, 45, 23], mode="markers")),
go.Frame(name=1, data=go.Scattergl(x=[8, 6, 5, 3, 8], y=[9, 7, 6, 4, 11], mode="markers"))
]
fig.update_layout(updatemenus=[dict(type="buttons",
buttons=[dict(label="►", method="animate", args=[None, {"fromcurrent": True}])])])
fig.frames = frames
fig.show()
And yes, I can’t just use Scatter. In my real work, there are tens and hundreds of thousands of points on each frame. I need hardware acceleration.