Makie, make axes invisible?

#1

I really enjoy the fastness of Makie! I think it can really become the next generation plotting tool for Julia.
Currently I am struggelling with the axis interface.
Is there any convenient possibility to make the axes of a plot invisible?

For 3DAxis I found

scene = Scene()
lines!(scene, sin.(0:0.1:2*pi))
axis = scene[Axis]
axis[:showaxis] = (false, false, false)

and for 2DAxis I found the property axis[:visible]
but neither the 2D nor the 3D versions work for me :frowning:

Currently I have the following workaround:

function axis_off(scene) 
    axis = scene[Axis]
    axis[:names][:axisnames] = ("","")
    axis[:grid][:linewidth] = (0, 0)
    axis[:ticks][:textsize] = (0, 0)
    scene
end

But I may be missing something …?
Thanks in advance for any help.

0 Likes

#2

Just realised, that

lines(sin.(0:0.1:2*pi), show_axis = false)

works, I must have had a typo somewhere, when trying the first time.
I would still be interested in knowing whether I could switch axes plotting on/off after the plot has been made…

P.S.: a nice example for Valentine’s Day :wink:

h(x) = abs(x)^(2/3) +  sqrt(3.3-x^2) * cos(150*pi*x)
lines(h.(LinRange(-sqrt(3.3),sqrt(3.3),10000)), color = :red, show_axis=false)
0 Likes