✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

How can I use one animation slider for two graphs?

I am currently putting 2 plotly express graphs in a Dash Div. I stated animation frame for both graph and there are 2 sliders separately now, I wanted one slider for two graphs to be updated.

Is there any workaround to make 2 figures share the same slider? Or I have to code another slider and make 2 callbacks myself?

I tried

fig_a.layout.sliders = fig_b.layout.sliders

and it won’t work.

Hi there!

I’d recommend reading through the documentation as most common usages like multiple outputs are talked about there.

https://dash.plot.ly/getting-started-part-2
(specifically the part that says multiple output)

I get it I could code a slider and make callbacks to update the graphs, but since plotly express has created the slider for me, I am looking for a way to use this slider for multiple graphs and make the code much cleaner.

Did you figure this out yet? I am having the same problem. If so, could you please tell me how?