The numbers on the colorbar are missing i the produced pdf figure although they do appear in the figure preview in VSCode. I don’t know what’s wrong.
The bigger problem: how do I remove those empty space? I have played around using colsize!, rowsize!, colgap!, rowgap! but I don’t seem to figure out the proper way to do it. When I was using Matplotlob, fig.tight_layout() does a pretty good job, and if not I can just use ax.set_position() to set the axis position manually to eliminate the margin. I would like to know if similar methods exist in Makie, and if not what’s the Makie way to do it properly.
It looks like hidedecorations!(...) on an Axis3 does not reclaim space like it does for a 2D Axis.
let
fig = Figure(resolution=(700, 300))
for i in 1:4
ax1 = Axis3(fig[1, i])
hidedecorations!(ax1) # same place taken if this is commented out
ax2 = Axis(fig[2, i])
hidedecorations!(ax2)
end
fig
end
protrusions: The protrusions on the sides of the axis, how much gap space is reserved for labels etc. Default: 30
let
fig = Figure(resolution=(700, 300))
for i in 1:4
ax1 = Axis3(fig[1, i]; protrusions=0)
hidedecorations!(ax1)
ax2 = Axis(fig[2, i])
hidedecorations!(ax2)
end
fig
end
We could think about doing that.
The issue is that the protrusions value of Axis3 is just a guess that works ok-ish by default, but not if you hide decorations, have really large ones, etc. The reason is that for Axis, how much the axis decorations protrude does only depend on the ticks, for Axis3 it does also depend on the exact projection. But because the projection changes with the layout space given to Axis3, the protrusions cannot also depend on this, otherwise you’d have a cycle in the layout logic.
Another option would be adding a function like auto_protrusions!(ax3) that tries to compute how far out the labels are currently sticking, and using that value. If you hid all of them, this would zero out the protrusions.
Thanks, I understand now, and fully support your approach,
which made the new layout system so robust.
Better having to enter some fixed values in a few known places
than a solver that do frustrating things at the worst moment, on complex figures.
I filed issue #2259 to track potential improvements about 3D protrusions.