Is there a way to automatically resize a figure to properly fit contained plots in a matplotlib/pylab image?
I\'m creating heatmap (sub)plots that differ in aspect rat
you can try using axis('scaled')
import matplotlib.pyplot as plt
import numpy
#some dummy images
img1 = numpy.array([[.1,.2],[.3,.4]])
img2 = numpy.array([[.1,.2],[.3,.4]])
fig,ax = plt.subplots()
ax.imshow(img1,extent=[0,1,0,1])
ax.imshow(img2,extent=[2,3,0,1])
ax.axis('scaled') #this line fits your images to screen
plt.show()