# Makie, Mesh, turning axis visibility

**URL:** <https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551>\
**Category:** New to Julia\
**Created:** [July 5, 2020, 12:35pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551 "2020-07-05T12:35:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 5, 2020, 12:35pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/1 "2020-07-05T12:35:22Z")

</div>

I have two objects displayed in two scenes within Makie. A box with axes appears up for each object. How do I turn these off? I include an image that shows the two sets of axes.

I realize that I could create a single scene, but I wish to manipulate the radius of each sphere via two `textsliders`, which requires each sphere to be in its own scene. In other words, I would like to better understand how to create `subscenes` with axis visibility turned off. Thank you.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/0/3041b1b122983070cc6887c4a7b971fe2d527e54.png)

Here is the code (I took out the slider bars since is a MWE):

```julia
using Makie
using AbstractPlotting # Not sure this is required

function makePlot_MWE()
    parent = Scene()
    s_sphere = Scene(parent)
    sphere = Sphere(Point3f0(0), .2f0)
    mesh!(s_sphere, sphere, color=:red) #, model=model)
    s_sphere1 = Scene(parent)
    sphere = Sphere(Point3f0(0.2, .3, .1), .5f0)

    mesh!(s_sphere1, sphere, color=:green)
    return parent
end

makePlot_MWE()

```

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [July 5, 2020, 12:36pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/2 "2020-07-05T12:36:49Z")

</div>

Each scene gets an Axis by default.  
Try: `show_axis=false`

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 5, 2020, 12:45pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/3 "2020-07-05T12:45:39Z")

</div>

It worked! Thank you.

```julia
function makePlot_works()
    marker_size = 0.0002
    sradius, s_marker_radius = textslider((0.5f0:0.25f0:10f0), "Radius", start=2.f0)
    sradius1, s_marker_radius1 = textslider((0.5f0:0.25f0:10f0), "Radius", start=2.f0)

    par = Scene(show_axis=true)

    s_sphere = Scene(par, show_axis=false)
    sphere = Sphere(Point3f0(0), .2f0)
    meshplot = mesh!(s_sphere, sphere, color=:red)
    on(s_marker_radius) do x
        scale!(meshplot, x, x, x)
    end

    s_sphere1 = Scene(par, show_axis=false)
    sphere1 = Sphere(Point3f0(0.2, .3, .1), .5f0)
    meshplot1 = mesh!(s_sphere1, sphere1, color=:green)
    on(s_marker_radius1) do x
        scale!(meshplot1, x, x, x)
    end

    parent = hbox(sradius, sradius1, par) #, parent=parenkjt_scene)
    setupCamera!(par);
    return parent
end

makePlot_works()

```

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 5, 2020, 12:58pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/4 "2020-07-05T12:58:15Z")

</div>

@sdanisch: I looked at the source code, and found the `Scene` `struct` and constructor with no mention of `show_axis` within `scenes.jl`. Except for a brief mention in the documentation, how would I deduce from the source code that `show_axis` was a valid argument to `Scene`? Isn’t this argument a popular one if `subscenes` are used? I did find scene\_attributes which contains `:show_axis` and other parameters, such as `:limits`. Does that mean that I can use the `limits` argument when invoking `Scene`? Things are getting a little clearer. Thanks.

```julia
function Scene(
        events::Events,
        px_area::Node{IRect2D},
        clear::Bool,
        camera::Camera,
        camera_controls::RefValue,
        scene_limits,
        transformation::Transformation,
        plots::Vector{AbstractPlot},
        theme::Attributes, # the default values a scene owns
        attributes::Attributes, # the actual attribute values of a scene
        children::Vector{Scene},
        current_screens::Vector{AbstractScreen},
        parent = nothing,
    )

```

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [July 5, 2020, 1:06pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/5 "2020-07-05T13:06:10Z")

</div>

Its a big mess that needs cleaning up 😃  
The scene struct should get a little overhaul soon!

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 5, 2020, 1:17pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/6 "2020-07-05T13:17:33Z")

</div>

Overall, Makie is very cool!

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 5, 2020, 4:53pm UTC](https://discourse.julialang.org/t/makie-mesh-turning-axis-visibility/42551/7 "2020-07-05T16:53:34Z")

</div>

@sdanisch:

Why would the following construct crash?

```julia
    AP.scatter!(parent_scene, x[1:1], y[1:1], z[1:1], markersize=.03, color=:darkblue, transparency=true)
    on(marker_radius) do x
        AP.scatter!(parent_scene, x[1:1], y[1:1], z[1:1], markersize=x[], color=:darkblue, transparency=true)

```

I do a scatter of a single point. This works, with `markersize=0.03`.  
I then add a statement to provide control via a slider. Notice the `markersize=x[]`. Why would the code now crash given that `x[]` is the underlying value of the Observable? What am I missing?

I now understand how to translate, scale, rotate, individual scene components, each considered as subscenes. I still would like the ability of modify details of a scene as I was trying to do above with `AP.scatter(...` , when simple matrix operations on the entire scene are not adequate. Can you help with this?  
Must I add and remove subscene components to the parent scene as opposed to updating them? For example, if I wish to modify the location of one of the markers via a text slider, how could I do this?

Thanks.
