I’m currently trying to create multipanel plots that all use DataAspect()
and I’ve been wondering if there’s a clever way to generate the optimal layout.
Here’s an example:
The panels are created such that all data limits have the same “height” and the second column is three times wider than the first.
fig = Figure(resolution=(700,400));
ax1 = Axis(fig[1,1], aspect=DataAspect(), limits=(0,1,0,1))
ax2 = Axis(fig[1,2], aspect=DataAspect(), limits=(0,3,0,1))
ax3 = Axis(fig[2,1], aspect=DataAspect(), limits=(0,1,0,1))
ax4 = Axis(fig[2,2], aspect=DataAspect(), limits=(0,3,0,1))
Box.([fig[1,1],fig[1,2], fig[2,1], fig[2,2]])
fig
I’m aware that I can use colsize!
but then I still have to manually tune the figure height
to minimize unused space.
fig = Figure(resolution=(700,419));
ax1 = Axis(fig[1,1], aspect=DataAspect(), limits=(0,1,0,1))
ax2 = Axis(fig[1,2], aspect=DataAspect(), limits=(0,3,0,1))
ax3 = Axis(fig[2,1], aspect=DataAspect(), limits=(0,1,0,1))
ax4 = Axis(fig[2,2], aspect=DataAspect(), limits=(0,3,0,1))
Box.([fig[1,1],fig[1,2], fig[2,1], fig[2,2]])
colsize!(fig.layout, 1, Relative(0.25))
fig