2024-06-10 15:41:37 发布
网友
我在用plotly构建地平线图时遇到了困难。我使用Implementing horizon charts in matplotlib中的演示代码matplotlib.plotly成功地构建了这个函数,但是plotly失败了,因为我在plotly中找不到任何函数来实现fill_between
plotly
matplotlib.plotly
fill_between
我想知道如何填充plotly中两条虚线之间的区域
只需像这样使用fill=tozeroy:
fill=tozeroy
绘图:
代码:
import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Scatter(x=[1, 2, 3], y=[0, 2, 3], mode = 'lines', fill='tozeroy')) fig.add_trace(go.Scatter(x=[1, 2, 3], y=[3, 5, 4], mode = 'lines', fill='tonexty')) fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5.5, 6], mode = 'lines', fill='tonexty')) fig.show()
只需像这样使用
fill=tozeroy
:绘图:
代码:
相关问题 更多 >
编程相关推荐