Animated scatter plot example from python lists

According to the animation examples in the docs, I need columns and grids for an animated plot like this and I need to create a frame for every frame of the animation.

column_1 = Column([0.5], โ€˜xโ€™)
column_2 = Column([0.5], โ€˜yโ€™)
column_3 = Column([1.5], โ€˜x2โ€™)
column_4 = Column([1.5], โ€˜y2โ€™)

grid = Grid([column_1, column_2, column_3, column_4])

However, I have two lists with equal lengths:

x = [1, 2, 3, 4, โ€ฆ 1000]
y = [1,5,10,15,20,โ€ฆ10000]

My python skills arenโ€™t developed enough yet to interlace and column-ify the simple lists into the grid and create a frame for every x / y pair. Can someone help give me a snippet of code that does this? i found an exmaple using dataframes and pandas to get the grid built, but Iโ€™m not sure of an approach to getting 1000 frames built out from these 1000 x/y pairs.

Hi @jsm,

Iโ€™m not sure I understand how you would like your x and y lists to be interleaved into the grid.

Also, you might want to consider building the animation in offline mode so you donโ€™t need to deal with build a grid (https://plot.ly/python/animations/#online-mode).

If you would like to upload the plot to Chart Studio, in plotly.py 3.7 (out in a week or so) it will be possible to upload an animated plot built in offline mode using plotly.plotly.create_animations().

-Jon

Jon,

Iโ€™ll look into that. My issue is that I have a series of x/y points as two separate lists and Iโ€™d like to animate the progression of the points.

Iโ€™m not sure if plotly is the right tool for the job. The data I have is time vs distance data (1 dimensional) and I want to play back visually how a race over that distance unfolded.

The data I have is in a csv that I can read into a grid via pandas, but it is a single column (list) and not organized like frames. Iโ€™d have to pivot the column to a row to convert it to a frame construct I think.