Hi, following this example on the website, if I replace all the Scatter traces with Scattergl, the error-band is not shown.
That is, using the following code (only change is that I use webgl):
import plotly.graph_objs as go
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/wind_speed_laurel_nebraska.csv')
fig = go.Figure([
go.Scattergl(
name='Measurement',
x=df['Time'],
y=df['10 Min Sampled Avg'],
mode='lines',
line=dict(color='rgb(31, 119, 180)'),
),
go.Scattergl(
name='Upper Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']+df['10 Min Std Dev'],
mode='lines',
marker=dict(color="#444"),
line=dict(width=0),
showlegend=False
),
go.Scattergl(
name='Lower Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']-df['10 Min Std Dev'],
marker=dict(color="#444"),
line=dict(width=0),
mode='lines',
fillcolor='rgba(68, 68, 68, 0.3)',
fill='tonexty',
showlegend=False
)
])
fig.update_layout(
yaxis_title='Wind speed (m/s)',
title='Continuous, variable value error bars',
hovermode="x"
)
fig.show()
It does work (for some reason) if and only if I reorder the scatter plots ([measurement, upper, lower] -> [upper, lower, measurement]) and I add fill='tonexty' to both the upper and lower traces.
That is:
import plotly.graph_objs as go
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/wind_speed_laurel_nebraska.csv')
fig = go.Figure([
go.Scattergl(
name='Upper Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']+df['10 Min Std Dev'],
mode='lines',
marker=dict(color="#444"),
fill='tonexty',
line=dict(width=0),
showlegend=False
),
go.Scattergl(
name='Lower Bound',
x=df['Time'],
y=df['10 Min Sampled Avg']-df['10 Min Std Dev'],
marker=dict(color="#444"),
line=dict(width=0),
mode='lines',
fillcolor='rgba(68, 68, 68, 0.3)',
fill='tonexty',
showlegend=False
),
go.Scattergl(
name='Measurement',
x=df['Time'],
y=df['10 Min Sampled Avg'],
mode='lines',
line=dict(color='rgb(31, 119, 180)'),
),
])
fig.update_layout(
yaxis_title='Wind speed (m/s)',
title='Continuous, variable value error bars',
hovermode="x"
)
fig.show()
Hi, following this example on the website, if I replace all the
Scatter
traces withScattergl
, the error-band is not shown.That is, using the following code (only change is that I use webgl):
It does work (for some reason) if and only if I reorder the scatter plots ([measurement, upper, lower] -> [upper, lower, measurement]) and I add
fill='tonexty'
to both the upper and lower traces.That is: