我想为x轴是日期时间的阶跃曲线下的区域着色,我尝试了色块,但它在曲线之间而不是曲线下提供了颜色。有没有更好的方法来着色曲线下的区域?
代码如下:
output_file("layout.html")
df = pd.read_csv( 'file')
df.day= df.day.apply(lambda x : parser.parse(x))
s = []
p_energy_patch = figure(title='graph', plot_width=1000, plot_height=300, x_axis_type="datetime")
p_energy_patch.step(x = df.day, y = df['total'], line_width=2, color="black", alpha=0.8)
p_energy_patch.patch(df.day, df['total'], color = "black",alpha=0.5, line_width=2)
tab2 = Panel(child=p_energy_patch, title="Normal+Patch(WH)")
tabs = Tabs(tabs=[ tab2])
s.append(tabs)
result = column(s)
show(result)