This is my code to create two subplots within another subplots and the result. I want to let the left and the right plots share their y-axes.
fig = plt.figure()
fig.suptitle('L1000N1800 AGN HMFs')
outer = fig.add_gridspec(1,2)
axout = outer.subplots()
for i in range (2):
axout[i].set_xticklabels([])
axout[i].set_yticklabels([])
axout[i].axis('off')
inner = outer[0,0].subgridspec(2,1,hspace=0)
ax = inner.subplots(sharex=True)
ax[0].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[0].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[0].errorbar(hmf_DMO_FIDUCIAL[0],STRONGEST_SN_DMO)
ax[0].set_yscale("log")
ax[0].set_xscale("log")
ax[1].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[1].set_yscale("log")
inner = outer[0,1].subgridspec(2,1,hspace=0)
ax = inner.subplots(sharex=True)
ax[0].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[0].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[0].set_yscale("log")
ax[0].set_xscale("log")
ax[1].errorbar(hmf_DMO_FIDUCIAL[0],hmf_DMO_FIDUCIAL[1])
ax[1].set_yscale("log")
fig.tight_layout()
fig.show()
I have tried axout = outer.subplots(sharey=True)
but this doesn't work.