Quick way to make axis invisible (Makiei)?

Hi!

I’m preparing some quite complex figures for a presentation and I would like to produce multiple versions of that figure with different parts of the layout shown/hidden. Is there any simple way to make an axis invisible (but keep the layout intact)? Like hideaxis!() or something alike?

Thanks!

While currently a Scene cannot be made invisible as far as I know, at least with the recent refactor it’s a bit easier to write a small helper function to go through a Block’s scene and hide everything in it.

function hide_block!(block)
    function _hide!(block::Scene)
        foreach(_hide!, block.plots)
        foreach(_hide!, block.children)
    end
    _hide!(plot) = plot.visible = false
    _hide!(block.blockscene)
    return
end

f = Figure()
axs = map(1:9) do i
    ax = Axis(f[fldmod1(i, 3)...])
    lines!(cumsum(randn(100)))
    ax
end
hide_block!.(axs[[1, 5, 9]])
f

1 Like

Very helpful, thanks!