Extending data to the same plot

Hi @bertaserracanta,

If you’re working in the Jupyter Notebook, the easiest way to do this would be to use a FigureWidget

First display a figure with an empty scatter trace

import plotly.graph_objs as go
import time
fig = go.FigureWidget(data=[go.Scatter(x=[], y=[])])
fig

Then update the data

i=0
scatter = fig.data[0]

while i<10:
    new_x = [3+i, 4+i]
    new_y = [3+i, i-4]
    with fig.batch_update():
        scatter.x += tuple(new_x)
        scatter.y += tuple(new_y)
    time.sleep(1)
    i = i+1

If you’re not working in the Jupyter Notebook, and you want a standalone web app. You could also accomplish the same this using Dash https://dash.plot.ly/.

Hope that helps,

-Jon