How can I have a bar next to python seaborn heatmap which shows the summation of row values? How can I have a bar next to python seaborn heatmap which shows the summation of row values? pandas pandas

How can I have a bar next to python seaborn heatmap which shows the summation of row values?


@Paul H subplot suggestion did work for my purposes. The code below got me the figure shown. Not sure if this is the most resource efficient method but it got me what I needed. enter image description here

fig = plt.figure(figsize=(20,15))ax1 = plt.subplot2grid((20,20), (0,0), colspan=19, rowspan=19)ax2 = plt.subplot2grid((20,20), (19,0), colspan=19, rowspan=1)ax3 = plt.subplot2grid((20,20), (0,19), colspan=1, rowspan=19)mask = np.zeros_like(pv)mask[np.tril_indices_from(mask)] = Truesns.heatmap(pv, ax=ax1, annot=True, cmap="YlGnBu",mask=mask, linecolor='b', cbar = False)ax1.xaxis.tick_top()ax1.set_xticklabels(pv.columns,rotation=40)sns.heatmap((pd.DataFrame(pv.sum(axis=0))).transpose(), ax=ax2,  annot=True, cmap="YlGnBu", cbar=False, xticklabels=False, yticklabels=False)sns.heatmap(pd.DataFrame(pv.sum(axis=1)), ax=ax3,  annot=True, cmap="YlGnBu", cbar=False, xticklabels=False, yticklabels=False)