Hi,
I am trying to do a filled area plot for which the traces has np.nan data. However, when np.nan data exist in the Y-axis of the trace the filling does not work as expected, i.e., It does not do the filling to the next Y trace anymore even though I am using the option fill=โtonextyโ.
Example without NAs work great:
trace1=go.Scatter(
x=[โW01โ,โW02โ,โW03โ,โW04โ,โW05โ,โW06โ],
y=[1.5,1.6,1.8,1.2,2,2.4],
name=โhighโ,
fill=None,
mode=โlinesโ
)
trace2=go.Scatter(
x=[โW01โ,โW02โ,โW03โ,โW04โ,โW05โ,โW06โ],
y=[1.4,1.3,1.2,0.9,2,2.1],
name=โlowโ,
fill=โtonextyโ,
mode=โlinesโ
)
data=[trace1, trace2]
fig = go.Figure(data=data)
import plotly
plotly.offline.plot(figure_or_data=fig, filename=โ/mnt/efs/downloads/tmp/test.htmlโ)
Example with NAs with the filling tonexty not working:
trace1=go.Scatter(
x=['W01','W02','W03','W04','W05','W06'],
y=[1.5,1.6,1.8,np.nan,2,2.4],
name='high',
fill=None,
mode='lines'
)
trace2=go.Scatter(
x=[โW01โ,โW02โ,โW03โ,โW04โ,โW05โ,โW06โ],
y=[1.4,1.3,1.2,np.nan,2,2.1],
name=โlowโ,
fill=โtonextyโ,
mode=โlinesโ
)
data=[trace1, trace2]
fig = go.Figure(data=data)
import plotly
plotly.offline.plot(figure_or_data=fig, filename=โ/mnt/efs/downloads/tmp/test_na.htmlโ)