plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Add date in subplots

Open Gleb-GG opened this issue 3 years ago • 0 comments

Hi everyone!

I'm currently trying to create 50 subplots which will update each second like real time. I don't use dash because visualizing with Jupiter is more important for me.

Well, here is an example of a pseudocode

rows = 50
fig = go.FigureWidget(make_subplots(rows = rows,  cols = 1, vertical_spacing = 0.005))
for i in range(1,rows+1):
        fig.add_trace(go.Scatter(line_color = ...), row = i, col=1)

After, I update my subplots by signals. I decimated date and added in fig

with fig.batch_update():
        for j in range(rows):
            fig.data[j].x = trace['Date'][START:END]      
            fig.data[j].y = trace.iloc[START:END, col_st:col_end][str(col_end)]

And this procedure takes 3 seconds each loop, which is a very long time for my tasks. My question is how I can add more faster date.

If anyone wants to repeat the code, create date with size 100 and add to each subplots.

Gleb-GG avatar Aug 27 '22 12:08 Gleb-GG