I have 2 variables that I would like to plot in separate subplots with errorbars. However, they both plot in the bottom subplot. How do I get them to plot in separate subplots?
from pandas import DataFrame, date_range, Timedelta
import numpy as np
from matplotlib import pyplot as plt
rng = date_range(start='2015-01-01', periods=5, freq='24H')
df = DataFrame({'y':np.random.normal(size=len(rng))}, index=rng)
y1 = df['y']
y2 = (y1*3)
sd1 = (y1*2)
sd2 = (y1*2)
fig,(ax1,ax2) = plt.subplots(2,1,sharex=True)
ax1 = y1.plot(yerr=sd1)
ax2 = y2.plot(yerr=sd2)