I want to visualize the process of fitting a straight line to a 2D dataset. For every epoch, I have the x and y coordinates of the starting point and the endpoint of the straight. Below is an example image of a dataset with a line (matplotlib).
I saw that plotly provides an option to animate lines.
The above plot was created with code similar to this:
# this should animate my line
fig_data = px.line(df, x="xxx", y="yyy", animation_frame="epoch", animation_group="name", title="fitted line")
# responsible for the red scatter plot points:
fig_data.add_traces(
go.Scatter(
x=xxx,
y=yyy, mode='markers', name='House in Dataset')
)
The dataframe looks like that:
epoch xxx yyy name
0 0 [0.5, 4] [1.4451884285714285, 4.730202428571428] example
1 1 [0.5, 4] [1.3944818842653062, 4.4811159469795925] example
2 2 [0.5, 4] [1.3475661354539474, 4.251154573663417] example
3 3 [0.5, 4] [1.3041510122346094, 4.03885377143571] example
So the line that should be shown in epoch 0 starts from (0.5,1.44) and goes to (4,4.73). However, no line is rendered. What should I change?