Dual y-axis on subplots

75 views Asked by At

I would like to create 3 stack subplots with dual y-axis on each subplot. Using the following code gives me a ValueError: too many values to unpack (expected 2). A bit lost on this and would appreciate some help. Thank you!

fig, (axes, axes1) = plt.subplots(nrows=3, ncols=1, sharex=True, figsize=(8,5))
fig.suptitle('Boiler Room Energy Use')


axes1 = axes.twinx()
axes[0].plot(data17['BoilerRmToT'])
axes[1].plot(data18['BoilerRmTot'])
axes[2].plot(data19['BoilerRmTot'])
axes1[0].plot(data17['Wet-Bulb F'], color='orange')
axes1[1].plot(data18['Wet-Bulb F'], color='orange')
axes1[2].plot(data19['Wet-Bulb F'], color='orange')

plt.xticks(data19.index[::1500])
0

There are 0 answers