Hi, Iโve created one working animated scatterplot using Plotly express and I would like to add a layer on top of that which connects certain markers to form a shape, which is then filled in with a colour. Since this is an animation the shape should change location and form along with the moving markers in a synchronized manner. Hereโs my code so far:
fig = px.scatter(df, x="X", y="Y", color="Team", hover_name="NickName", animation_frame="GameTime",
animation_group="NickName", range_x=[-4,110], range_y=[-4,72], size='Position', size_max=11,
width=900, height=700, color_discrete_map=color_discrete_map,
hover_data={'X': False,'Y':False,'GameTime':False,'size':False, 'Team':False, 'Position':False})
All necessary information is currently in the dataframe for each row. Is it possible to create a second px.scatter to layer on top somehow and fill the area with a colour? Or would I have to use go.scatter, create multiple traces, and then use frames to somehow synchronize them? Any hints on the best approach would be appreciated. Thanks!