I have a small issue where there is some unwanted whitespace on the right of my figure. Also, the behaviour of colgap is a bit weird to me with 3D plots.
The code I am using just makes four 2d plots and four 3d plots in a grid 2*8 grid:
using CairoMakie
function plot2d(f)
x,y = rand(100), rand(100)
ax = Axis(f[1,1])
hidedecorations!(ax)
scatter!(ax,x,y)
end
function plot3d(f)
x,y,z = rand(100), rand(100), 100 .*rand(100)
ax = Axis3(f[1,1])
hidedecorations!(ax)
scatter!(ax,x,y,z)
end
f = Figure(size = (500,300),fontsize=10,pt_per_unit=1)
for i in 1:2, j in 1:2
plot2d(f[i,2*j-1])
plot3d(f[i,2*j])
end
rowgap!(f.layout,0)
colgap!(f.layout,0)
f
The above code produces a figure with more whitespace on the right than the left, and the gap between rowws and columns is not zero. Is there a way to remedy both of these facts?
With 2D plots, the plots have exactly zero gap as expected and the whole figure is symmetric:
I can get the plots closer together using negative col/row gaps, but it’s a bit of guesswork on how negative they need to be. Am I missing some property somewhere that will help with this?