Plotly.py: fill between lines, different color por positive/negative
问题 With Plotly, I can easily plot two lines and fill the area between them: import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Scatter( x=[1, 2, 3, 4], y=[-1, -.2, 1, 2], fill=None, mode='lines', )) fig.add_trace(go.Scatter( x=[1, 2, 3, 4], y=[-1, -.5, 0.2, .5], fill='tonexty', mode='lines', )) fig.update_layout(title_text='hello world') fig.show() How can I make it to separate the filled area in two? In particular, filling with red where y < 0 and with green where y > 0 .