Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide play and stop buttons in plotly express animation

How can I remove the play and stop buttons and just keep the slider?

import plotly.express as px
import pandas as pd

df = pd.DataFrame(dict(x=[0, 1, 0, 1],
                       y=[0, 1, 1, 0],
                       z=[0, 0, 1, 1]))
px.line(df, "x", "y", animation_frame="z")

enter image description here

like image 705
Max Ghenis Avatar asked Sep 12 '25 17:09

Max Ghenis


1 Answers

fig = px.line(df, "x", "y", animation_frame="z")
fig["layout"].pop("updatemenus")
fig.show()

enter image description here

like image 162
veedata Avatar answered Sep 14 '25 09:09

veedata