Changing active slider value in plotly doesn't change the displayed data

Viewed 117

How can I change the displayed data subset when using animation_frame? fig.update_layout(sliders=[dict(active=...)]), shown in the docs, only changes the value selected on the slider itself, but not the actual data. In this example, it's still showing the data associated with z=1 (notebook).

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]))

fig = px.line(df, "x", "y", animation_frame="z")
fig.update_layout(sliders=[dict(active=1)])
fig.show()

enter image description here

(Also filed https://github.com/plotly/plotly.py/issues/3276).

0 Answers
Related