12345678
import plotly.graph_objects as gofig = go.Figure()fig.add_trace(go.Scatter(x=[1, 2, 3, 4], y=[0, 2, 3, 5], fill='tozeroy')) # fill down to xaxisfig.add_trace(go.Scatter(x=[1, 2, 3, 4], y=[3, 5, 1, 7], fill='tonexty')) # fill to trace0 yfig.show()
1234567891011121314151617
import plotly.graph_objects as gofig = go.Figure()fig.add_trace(go.Scatter( x=[1, 2, 3, 4], y=[3, 4, 8, 3], fill=None, mode='lines', line_color='indigo',))fig.add_trace(go.Scatter( x=[1, 2, 3, 4], y=[1, 6, 2, 6], fill='tonexty', # fill area between trace0 and trace1 mode='lines', line_color='indigo'))fig.show()