I want to create a plot with multiple subplots involving heatmaps and barplots. I am facing problems with using shared X axis across the plots.
This is my code:
fig = plt.figure(figsize=(4, 4))
f,(ax0,ax1,ax2) = plt.subplots(3,1,sharex=True,figsize=[3,8],
gridspec_kw={'height_ratios':[1,0.25,1],'width_ratios':[1]})
ax0.get_shared_x_axes().join(ax1,ax2)
g0 = sns.barplot(data=tpm,color='blue',ax=ax0,lw=lw)
g1 = sns.heatmap(prep(sex),cmap=sex_clr,cbar=False,ax=ax1,linewidths=lw,linecolor='white')
g1.set(xlabel='',ylabel='')
g3 = sns.barplot(data=tmb_val,color='blue',ax=ax2,lw=lw)
This is my output:
Here I mentioned sharex=True and also used get_shared_axes() but nothing worked. Can anyone help me with this?