gpt4 book ai didi

python - 在 plotly 表达动画中隐藏播放和停止按钮

转载 作者:行者123 更新时间:2023-12-03 08:18:25 27 4
gpt4 key购买 nike

如何删除播放和停止按钮并仅保留 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

最佳答案

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

enter image description here

关于python - 在 plotly 表达动画中隐藏播放和停止按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68624485/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com