mc3
mc3 copied to clipboard
Automate caption sizes / location
You can get the size of a label with this:
text_size = yl.get_window_extent().height / fig.get_window_extent().height
which you can compare to the size of its axes:
axes_size = ax.get_position().height
The idea is to automate the size of captions when there are few/many subplots, to avoid having overlapping/tiny captions.
See plt.tight_layout()