Speed up the processing time a duplicated plot


So I have a plot displaying a time series data. I want to create a duplicated zoomed-in version of it, which I used as following:

f_zoomed = go.Figure(f_initial, layout_xaxis_range [scp_df_zoom.value_timestamp.min(),scp_df_zoom.value_timestamp.max()])


This took much longer to process since it has to plot twice. Is there a way to optimize this process?

Hi @Khoa_Dang

That’s a great question where if I was to tackle would require experimentation by comparing the various ways in rendering the plot and seeing which approach gives the best performance.

For instance, you could compare the rendering of the zoomed-in and zoomed-out versions as 2 distinct figures then comparing that with the version where there is a single figure with 2 sub-plots. Here, you can use streamlit-profiler to benchmark and compare these 2 approaches. More info here:

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.