2D Liveplot with stop buttom in Plotly

I would like to create a simple code that would plot “slice by slice” a 2D plot that would look like the first one in this example: Custom buttons in Python

The “problem” is that each slice (let’s say a 1*10000 points numpy array) is measured by a device so the whole dataset is not known in advance.

I first thought using animations (Intro to animations in Python) but it seems I need to have the dataset at first and then I make an animation of it. Is there a way to also fill the dataset on the fly each time?

Let me know if I was absolutely not clear :slight_smile: