✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Stacking large scatter traces with plotly express


I’m trying to plot stack traces using plotly express px.line. With a rather small pandas dataframe, px.line generates a figure with scatter objects, thus I succeeded by using:
fig.update_traces(stackgroup=‘one’, mode=‘lines’)

While upscaling to a larger dataframe using the same script, px.line generates a figure with scattergl objects and I face the following error:
Invalid property specified for object of type plotly.graph_objs.Scattergl: ‘stackgroup’

Looking at the documentation (checked on 09/10/20), there is indeed no ‘stackgroup’ property for scattergl, even though there are references to it in ‘fill’ attribute.

Q1: Is it possible to “force” px.line to use scatter instead of scattergl?

I guess a simple workaround is to generate a figure without px and explicitly use scatter instead of scattergl; at the cost of code readability (px is a really nice feature for this) and performance.

Q2: Would it be possible to align scattergl documentation and behaviour by either adding stacking feature or editing “fill” chapter of documentation? - I’m not sure it’s the right place to ask though… sorry for that.

Many thanks,

env: windows 10 / python 3.7.3 (anaconda) / plotly 4.11.0