Loading the html takes ages while the HTML include more shapes

Hi All,
I used plotly to plot sensor data and i used the shapes feature to draw a grid like engineering graph paper. and everything working alright when the number of points plotted is less because when the points are less number of grid lines are drawn in other words less , lesser number of shapes are drawn because each gridline is a shape .I have to plot lakhs of data now so tens of thousands of shapes should be drawn to form the grid. the html is generated but it takes forever to load the graph. Is there any way to improve the performance when tens of thousands of shapes(lines) are drawn .so that graph loads . Any help will be appreciated.
Thank you

Hi @sooraj12345,

Performance is going to be pretty poor with thousands of layout.shapes objects. So the best approach is to work through how to reduce the number of shapes or how to implement the outcome you’d like with another approach.

To draw a graph-paper style grid, could you use styled grid lines?

Something like

import plotly.graph_objs as go

fig = go.FigureWidget()
fig.layout.xaxis.dtick = 0.5
fig.layout.yaxis.dtick = 0.5

fig.layout.xaxis.gridcolor = 'lightblue'
fig.layout.yaxis.gridcolor = 'lightblue'




1 Like

First of all thanks a lot for trying to help me .

This is the kind of Grid Pattern that i am trying to implement.
I will try to execute your suggestion and build this kind of grid pattern and get back to you .

Thanks a lot for the information.It helped me too.