Rk_values= [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
dff_vis= df[df['Rk'].isin(Rk_values)]
fig= px.scatter(dff_vis,
x= "Pts",
y= "Rk", range_y= [21, 0],
color= 'Rk'
animation_frame='Year', animation_group= 'Rk', range_x= [10,100], height= 800,
hover_name= "Squad",
hover_data= ["Top Team Scorer", "Goalkeeper", "Year"],
title= "Data Visualisation of the entire Premier League Points history")
#fig= fig.update_traces(mode= 'markers+lines')
fig= fig.update_yaxes(autorange= "reversed", title_text= "League Position", tickvals= [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
fig= fig.update_xaxes(title_text= "Points")
fig.layout.updatemenus[0].buttons[0].args[1]['frame']['duration']= 2000
fig.layout.updatemenus[0].buttons[0].args[1]['transition']['duration']= 1
I am currently using px.scatter to make an “ols” trendline and every time it jumps to the next/following year,
the previous existing points are deleted/ disappeared. How do I prevent the existing points in the scatterplot from fading as it goes through all the years in the dataframe?