Hi Forum,
firstly, huge congrats to the plotly devs for providing such a neat library with high level API that simply looks stunning from the get go. I love how easy it is to create animationsā¦ alas, iām struggling a lot with what is provided in the documentation on making animations:
Iām interested in creating a bar chart showing two categories, so far so easy:
my data
period value rank mygroup
1 100 2 blue
1 500 1 red
1 200 2 blue
2 100 2 blue
2 500 1 red
2 200 2 blue
import plotly.express as px
fig = px.bar(df, y=ārankā, x=āvalueā, color=āmygroupā,
animation_frame=āperiodā)
which looks fine ā however if i wanted to change the coloring dynamically
period value rank mygroup
1 100 2 blue
1 500 1 red
1 200 2 blue
2 100 2 blue
2 500 1 blue
2 200 2 blue
what plotly ends up doing is to show the graph with a blank bar where the red bar should show up.
Iām really not sure what role animation_group plays and i canāt figure out how to do the dynamic change of colors using the API, so any help would be greatly appreciated!
Thanks!