-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Hi, Thanks for this AWESOME project. I really enjoy using it.
The animation function can't keep the global consistency of color mapping between animation frames.
Here is an example in Colab for my use case. In this example, I use Plotly.py with scatter_geo API. My code is as between,
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter_geo(df, locations="iso_alpha",
color="lifeExp",
hover_name="country",
size="pop",
animation_frame="year",
projection="natural earth")
fig.show()
I expect the color mapping for lifeExp
to keep consistent between different frames, which means the same color among frames should represent the same lifeExp
value and the color bar should keep the same too. But the result looks like below, in which the frames in 1952 and 1997 can't be comparable.
I would expect some API like,
fig = px.scatter_geo(df, locations="iso_alpha",
color="lifeExp",
keep_color_global_consistency = True,
hover_name="country",
size="pop",
animation_frame="year",
projection="natural earth")
eg, it has keep_color_global_consistency
option and the default value should be True
.