I tried to plot two images next to each other with one corresponding colorbar for both of them. My code is
plt.figure(1)
plt.subplot (121)
plt.title('1')
plt.imshow(matrix_lg, interpolation='bilinear', cmap=plt.cm.jet, vmin=np.log10(minVal), vmax = np.log10(maxVal))
plt.subplot(122)
plt.title('2')
plt.imshow(matrix_lg, interpolation='bilinear', cmap=plt.cm.jet, vmin=np.log10(minVal), vmax = np.log10(maxVal))
plt.colorbar()
Python now attaches the colorbar to the second subplot and shrinks it therefore. But I want both plots to be the same size. How can I detach the colorbar of the subplots?

