[python]代码库
import plotly.graph_objects as go
fig = go.Figure(
data=[go.Scatter(x=[0, 1], y=[0, 1])],
layout=go.Layout(
xaxis=dict(range=[0, 5], autorange=False), yaxis=dict(range=[0, 5], autorange=False), title="Start Title",
updatemenus=[dict(type="buttons", buttons=[dict(label="Play", method="animate", args=[None])])]
),
frames=[go.Frame(data=[go.Scatter(x=[1, 2], y=[1, 2])]), go.Frame(data=[go.Scatter(x=[1, 4], y=[1, 4])]),
go.Frame(data=[go.Scatter(x=[3, 4], y=[3, 4])], layout=go.Layout(title_text="End Title"))]
)
fig.show()
[代码运行效果截图]
高级设计师
by: Python自学 发表于:2022-11-18 03:33:28 顶(1) | 踩(1) 回复
python运行后会打开一个网页,点击play会播放动画
回复评论