在 pandas 中绘制 fill_between() [英] plotting fill_between() in pandas
本文介绍了在 pandas 中绘制 fill_between()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从两个数据帧创建了一个熊猫图:
I created a pandas plot from two dataframes:
ttload.plot(legend=True, figsize=(12,7))
zzload.plot(legend=False)
现在,我想使用 fill_between
函数来生成 0(橙色线)和 最小值和最大值 之间的阴影区域蓝线的强>.
Now, I would like to use the fill_between
function to generate a shaded region between 0 (the orange line) and the min and max values of the blue line.
我已将蓝色的最小值和最大值保存在变量 w_min
和 w_max
中.
I have saved the min and max values of blue in variables w_min
and w_max
.
关于如何做到这一点的任何想法?
Any ideas on how I can do that?
推荐答案
ax = ttload.plot(legend=True, figsize=(12,7))
zzload.plot(legend=False,ax=ax)
ax.fill_between(ttload.index,ttload['value'], zzload['value'])
这篇关于在 pandas 中绘制 fill_between()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文