Вы можете играть с height_ratios
из GridSpec
:
import matplotlib.gridspec as gs
site = np.random.random(size=(2,20))
country = np.random.random(size=(20,20))
fig = plt.figure()
N_rows_site, _ = site.shape
N_rows_country, _ = country.shape
grid=gs.GridSpec(2,2, height_ratios=[N_rows_site,N_rows_country], width_ratios=[50,1])
ax1 = fig.add_subplot(grid[0,0])
ax2 = fig.add_subplot(grid[1,0], sharex=ax1)
cax = fig.add_subplot(grid[:,1])
sns.heatmap(site, cmap="inferno", ax=ax1, cbar_ax=cax)
sns.heatmap(country, cmap="inferno", ax=ax2, cbar_ax=cax)
plt.setp(ax1.get_xticklabels(), visible=False)
с другим количеством линий:
site = np.random.random(size=(10,20))
country = np.random.random(size=(20,20))