I want to put two plots in a paper but I am stuck with them standing "tall".
grid = AxesGrid(
fig,
(0.075, 0.075, 0.85, 0.85),
nrows_ncols=(2, 1),
axes_pad=0.1,
label_mode="L",
share_all=True,
cbar_location="right",
cbar_mode="single",
cbar_size="3%",
cbar_pad="2%",
)
for i, fn in enumerate(fns):
ds = yt.load(fn) # load data
p = yt.SlicePlot(ds, "z", ("gas", "density"))
plot = p.plots[("gas", "density")]
plot.figure = fig
plot.axes = grid[i].axes
plot.cax = grid.cbar_axes[i]
p.render()
plt.show()
If I use this code this is what I get.

I tried to use gridspec but I never succeded