Following the animation example, I am attempting to animate the following data frame (available at this dropbox link):
(Pdb) df
date cases_per_capita population_density county_state state_abbr
0 2020-01-21 0.000001 290.1 Snohomish Washington WA
1 2020-01-22 0.000001 290.1 Snohomish Washington WA
2 2020-01-23 0.000001 290.1 Snohomish Washington WA
3 2020-01-24 0.000001 290.1 Snohomish Washington WA
4 2020-01-25 0.000001 290.1 Snohomish Washington WA
... ... ... ... ... ...
82507 2020-04-22 0.000323 5.5 Edwards Kansas KS
82508 2020-04-23 0.000323 5.5 Edwards Kansas KS
82509 2020-04-22 0.000412 6.1 Highland Virginia VA
82510 2020-04-23 0.000412 6.1 Highland Virginia VA
82511 2020-04-23 0.000178 6.8 Gray Kansas KS
[82512 rows x 5 columns]
The below animation code shows nothing in the plot area, and only one state abbreviation in the legend, WA. The play button proceeds to move the time bar across the dates but only WA counties appear.
import plotly.express as px
pxy=px.scatter(df,
x='population_density', y='cases_per_capita',
animation_frame='date', animation_group='county_state',
hover_name='county_state',
log_x=True,log_y=True,
range_x=[1,100000],range_y=[2e-6,.01],
color='state_abbr',
size='population_density'
)
pxy.show()