【发布时间】:2021-12-03 15:01:20
【问题描述】:
我有一个动画散点图,通常在 0-0.5 范围内绘制 x,y 坐标,日期/时间是帧键。但是有时我将不得不处理异常数据点,这些数据点将超出此范围。我希望图表能够动态缩放,以便点不会在屏幕外丢失。这可能吗?
def draw(x1,y1,timestamp):
d = {
"x1": x1_trim,
"y1": y1_trim,
"time": time_trim
}
df = pd.DataFrame(d)
fig = px.scatter(df, x="x1", y="y1", animation_frame="time")
fig.update_yaxes(autorange=True)
fig.update_xaxes(autorange=True)
fig.show()
我尝试过使用带有 autorange 的 update_x/yaxes,但它似乎不起作用。
【问题讨论】:
-
每一帧都可以有自己的布局,plotly.com/python-api-reference/generated/…看看帧定义
标签: python python-3.x plotly plotly-python