The problem here is again that the layout cannot use the information that objects want to have a certain aspect ratio. If it could then we would have an optimization problem, while the layout follows a deterministic algorithm. If you give an axis aspect = DataAspect() that means that it will reduce its frame from the available space so that the visual aspect ratio is the same as that of the data. This will leave gaps if the available space doesn’t perfectly fit the required size already.
You can either go all the way inside out and fix the axis sizes completely, then resize the figure to fit as in @piever’s snippet.
Or you can say, well at least if the axes shrink down, they should do so in a way that they end up with the same height. (If you could fix the height and enforce aspect of each axis, you would immediately have to have a certain fixed width per axis, so that would again break the layout if the widths didn’t add up perfectly by chance.)
So you can reach this goal by making the layout size all columns with correct relative ratios, given the xlimits of your axes. You do that by setting their width to Auto(span), which will distribute the available space according to the size of each span. Then all axes have to reach the same height if they resize themselves using DataAspect().
scene, layout = layoutscene(resolution = (1000, 400))
spans = range(0.2, 1, length = 5)
for (i, span) in enumerate(spans)
ax = layout[1, i] = Axis(scene, aspect = DataAspect(),
limits = (0, span, 0.0, 1.0))
poly!(ax, Circle(Point2f0(span / 2, 0.5), 0.1))
colsize!(layout, i, Auto(span))
end
scene
