mplotutils icon indicating copy to clipboard operation
mplotutils copied to clipboard

enable set_map_layout for subfigures

Open mathause opened this issue 2 years ago • 1 comments

I doubt this is possible. Currently subfigs can only have relative sizes, and it seems not possible to change them after the fact. Also the can be nested or vertical (I guess it would only work if they would span the whole width of the figure).

%matplotlib

import mplotutils as mpu
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

f = plt.figure()

sf1, sf2 = f.subfigures(2, 1)

axs = sf1.subplots(1, 2, subplot_kw={"projection": ccrs.Robinson()})
sf1.set_facecolor("0.5")
sf1.canvas.draw()

# errors
# mpu.set_map_layout(axs)

mathause avatar Feb 22 '24 16:02 mathause

Maybe just raise an error?

mathause avatar Mar 28 '24 16:03 mathause