I need to create multiple columns and rows of unequal size in matplotlib. Here is a sample code:
a = np.random.rand(20, 20)
b = np.random.rand(20, 5)
c = np.random.rand(5, 20)
d = np.random.rand(5,5)
arrays = [a,b,c,d]
fig, axs = plt.subplots(2, 2, sharex='col', sharey= 'row', figsize=(10,10))
for ax, ar in zip(axs.flatten(), arrays):
ax.imshow(ar)
However, I get this as a result.

The right column has images of unequal width for the first and second row, and I would want them to be equal (basically shrink the bottom right image to have the same scale as other images). I had researched this a fair amount, but nothing seems to work. I had tried tight_layout(), some other formatting tricks, all to no avail...
