Scattergl plots disappearing

Hi, im using dash and plotly to display 10 individual graphs on a single page. using Scatter causes a very sluggish interaction with the plots. When i try to use Scattergl some of my plots disappear. what are my options to use Scattergl or to just get a responsive graph that don’t disappear. Whats happening to my plots?

Hi @notsolowki,
Did you manage to figure this out? I have the same problem and scatter just won’t cut it. With 10 graphs on a page refreshing every 30sec, randomly some will just not render. Each refresh this will change and plots that were previously empty update correctly and others will then be blank.

There’s a limit of 8 scattergl plots per page, due a limited number of WebGL contexts made available to the page by the browser.

Thanks @nicolaskruchten that was a quick response. Makes sense. Its something I’d like to get around if possible. There isn’t really a substitute for scattergl with large datasets unfortunately. Appreciate the post

There is a workaround for testing purposes at least. For Chrome there is a command line switch “–max-active-webgl-contexts=”. Its not ideal as this would need to be done for any browser trying to use such an app. You could potentially run into resource issues when running it. However it appears to be working for me with 10 graphs so far.

Hi,

I just have the same problem when rendering plotly .express Scatter plots, and I fixed the issue setting render_mode=‘svg’ instead of the default mode: render_mode=‘auto’ ( in which case Plotly Express will automatically set rendermode=“webgl”).

When creating a scatter:

fig = px.scatter(df, x=“x”, y=“y”, render_mode=‘svg’)

Now I can render more than 8 scatter plots and now any line or complete plot “disappears”.

The explanation can be found here: Webgl vs svg in Python