# Slider or drop menus in Makie

**URL:** https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560
**Category:** Visualization
**Tags:** package, plotting, makie
**Created:** [April 4, 2021, 4:04pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560 "2021-04-04T16:04:42Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [April 4, 2021, 4:04pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/1 "2021-04-04T16:04:42Z")

</div>

Hello,  
probably the following is too much to ask, but could someone please take a look at this and see if it is possible to add two drop menus for `l` and `m`, or two sliders, either will be fine. I tried to follow the documentation but I’m not getting something. Thanks.

> <https://github.com/lazarusA/MakieNotebooks/blob/main/scripts/sphericalHarmonicsPlot.jl>

 ![sblackY10](https://global.discourse-cdn.com/julialang/original/3X/c/3/c38d17e68496d80b3dd355a14f93e13a8afafa63.png)

Probably @jules or @ffreyer [sorry for the tag].

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [April 4, 2021, 6:03pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/2 "2021-04-04T18:03:51Z")

</div>

I made an example here:

> <https://gist.github.com/jkrumbiegel/d88b503ef027b644cbeeefffd2981f01>

This is how it looks:

[https://i.imgur.com/4xGqkJS.mp4](https://i.imgur.com/4xGqkJS.mp4)

---

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [April 4, 2021, 6:17pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/3 "2021-04-04T18:17:01Z")

</div>

Thank you, that’s exactly what I was aiming for. Although the documentation is pretty clear nowadays, I still struggle with the `lifts` and Nodes.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [April 4, 2021, 6:29pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/4 "2021-04-04T18:29:13Z")

</div>

It’s always helpful to start at the top. What are your parameters that everything depends on? Here that’s l and m, so make those Nodes. Then lift everything that depends on them and feed that to the plotting functions. Sometimes one has to be a bit clever with the order of operations, or to avoid misaligned array lengths in observables etc, but that’s it. Then at the end, connect your slider or whatever to the initial parameter observables to change them.

---

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [April 4, 2021, 7:50pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/5 "2021-04-04T19:50:16Z")

</div>

I see. Thank you.  
By the way, currently there is not such a thing like `label = "l", labelcolor = :white` in the Slider, i.e.

`Slider(fig, range = 1:10, startvalue = 4, label = "l", labelcolor = :white)`

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [April 4, 2021, 7:55pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/6 "2021-04-04T19:55:36Z")

</div>

yeah that’s because the label could in theory go anywhere, so I didn’t want to add it to the slider. There’s `labelslider!` though which makes a Slider with two corresponding Labels. [http://makie.juliaplots.org/stable/makielayout/reference.html#AbstractPlotting.MakieLayout.labelslider!-Tuple{Any,%20Any,%20Any}](http://makie.juliaplots.org/stable/makielayout/reference.html#AbstractPlotting.MakieLayout.labelslider!-Tuple%7BAny,%20Any,%20Any%7D)

---

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [April 4, 2021, 8:03pm UTC](https://discourse.julialang.org/t/slider-or-drop-menus-in-makie/58560/7 "2021-04-04T20:03:03Z")

</div>

yeah, I saw that. Although I think it makes sense to have also the title in the slider call, [Interact.jl](https://github.com/JuliaGizmos/Interact.jl) gives those as default [with some common places for the position of such label], or you can specify them at the time of definition. At least that’s my previous experience with this kind of situations.
