2017-07-20 136 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