I am trying to plot three plots on one figure. Left two are just regular plots, but the top right one needs to be a correlation matrix with three additional colorbars, but I can't seem to get the sizes of colorbars right.
I tried with gridspec and subgridspecs like this:
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.colors import ListedColormap
import numpy as np
np.random.seed(123941)
data = np.random.rand(20, 20)
cmap_bm_type = ListedColormap(['mediumseagreen', 'greenyellow', 'darkorchid', 'plum'])
fig = plt.figure(figsize=[12, 8])
gs = gridspec.GridSpec(2, 2, figure=fig)
ax1 = fig.add_subplot(gs[0])
sgs = gs[1].subgridspec(2, 3, height_ratios=[0.95, 0.05],
width_ratios=[0.15, 0.70, 0.15],
wspace=0.05)
ax2 = fig.add_subplot(sgs[1])
ax2.imshow(data)
ax2.axis('off')
cbar_left = fig.add_subplot(sgs[0])
cbar_bottom = fig.add_subplot(sgs[2])
cbar_right = fig.add_subplot(sgs[4])
ax3 = fig.add_subplot(gs[2])
plt.show()
Can anybody help me how I could make ´cbar_bottom´ the same width 'visually' as the ´ax2´ ?

After quite a while I finally found a solution. I helped myself with this example from matplotlib docs.
Here is an example:
I hope this helps someone else too.