I'm creating a matplotlib figure. And I want the size (or at least the aspect ratio) of the output image to be consistent.
It seems like using figsize
changes the contained figure but not the image.
fig, ax = plt.subplots(figsize=(9,9))
ax.barh([0,1,2],[1,5,3])
ax.set_yticks([0,1,2])
ax.set_yticklabels(['a','b','c'])
While a change in the ticklabels
enlarges the image
fig, ax = plt.subplots(figsize=(9,9))
ax.barh([0,1,2],[1,5,3])
ax.set_yticks([0,1,2])
ax.set_yticklabels(['a really really really really really really long name','b','c'])
I wish for the opposite - keep the output the same size and have the chart change as needed.