Hi,
I have following data:
hubs batch raw_x raw_ y
0 NaN 8 634006.272684 5.823694e+06
1 4048 8 634006.184948 5.823694e+06
2 3500 8 634006.104805 5.823694e+06
3 2002 8 634006.025005 5.823695e+06
4 3102 8 634005.919790 5.823695e+06
5 3060 8 634005.810445 5.823695e+06
6 1573 8 634005.734756 5.823695e+06
7 NaN 39 634005.536396 5.823695e+06
8 1573 39 634005.501772 5.823695e+06
9 4050 39 634005.427821 5.823695e+06
10 3500 39 634005.412689 5.823696e+06
11 3102 39 634005.347912 5.823696e+06
12 3060 39 634005.217421 5.823697e+06
My goal is to plot for each batch (displayed in frames; one batch per 1 frame) those points and color them with respect to hub column (it means that I want point labaled as 4048 to be for example always blue).
Here is my code which attempts to do that:
fig = px.scatter(data, x=โraw_xโ, y=โraw_yโ, animation_frame=โbatchโ,
color=data.hubs.astype(str)
)
Unfortunately, in second frame (batch==39) I can see old point from the last frame (which is point labeld as 4048) and I donโt want to see that. How can I do that?