2017-07-20 94 views
1

我创建了一个熊猫的情节从两个dataframes fill_between():绘制的大熊猫

ttload.plot(legend=True, figsize=(12,7)) 
zzload.plot(legend=False) 

enter image description here

现在,我想用fill_between功能0之间产生阴影区域(橙色线)以及蓝线的最小值和最大值。

我已经在变量w_min和w_max中保存了蓝色的最小值和最大值。

任何想法,我可以做到这一点?

回答

0

您是否尝试过pyplot教程?

import matplotlib.pyplot as plt 
import numpy as np 

x = np.arange(0.0, 2, 0.01) 
y1 = np.sin(2*np.pi*x) 
y2 = 1.2*np.sin(4*np.pi*x) 

fig, (ax1, ax2, ax3) = plt.subplots(3, 1, sharex=True) 

ax1.fill_between(x, 0, y1) 
ax1.set_ylabel('between y1 and 0') 

plt.show() 
0
ax = ttload.plot(legend=True, figsize=(12,7)) 
zzload.plot(legend=False,ax=ax) 

ax.fill_between(ttload.index,ttload['value'], zzload['value']) 

enter image description here