Plotly Express using px.scatter and pd dataframe only seems to take the color attributes for the values in the dataframe column for the first frame of the time animation slider.
Yet if no color parameter is passed through then all values show but of course are not divided up by colour.
CSV data file: https://github.com/nightingaleandrew/olympic_visualisations CSV then convert to df.
import plotly.express as px
import pandas as pd
fig = px.scatter(df,
x="% of New Nations That Take Up The Sport",
y="Age of Sport",
animation_frame="Year",
animation_group="Sport ",
size="Number of Participating Nations",
color="Sport ", #only shows data from first frame values of Sport column
hover_name="Sport ",
title="I wonder if new nations take up younger sports?",
range_x=[0,100],
range_y=[0,100],
)
fig.show()
Further, color_discrete_map with keys (values of column) & values (colours) does not seem to work either.
Any suggestions? Thanks!