# \#observables

**URL:** https://discourse.julialang.org/tag/observables/1181.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to insert an interactive condition inside a Makie recipe?](https://discourse.julialang.org/t/how-to-insert-an-interactive-condition-inside-a-makie-recipe/137482)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 6\
**Last updated:** [June 7, 2026, 6:04pm UTC](https://discourse.julialang.org/t/how-to-insert-an-interactive-condition-inside-a-makie-recipe/137482 "2026-06-07T18:04:27Z")

</div>

The following MWE is self-explanatory: using GLMakie import Makie # define recipe with condition "showlines" Makie.@recipe(MyPlot, x, y) do scene Makie.Attributes(; showlines=true ) end # toggle between scatte…

---

## [How to call multiple Makie recipes for heterogeneous collections?](https://discourse.julialang.org/t/how-to-call-multiple-makie-recipes-for-heterogeneous-collections/137483)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [June 7, 2026, 4:29pm UTC](https://discourse.julialang.org/t/how-to-call-multiple-makie-recipes-for-heterogeneous-collections/137483 "2026-06-07T16:29:52Z")

</div>

The MWE is self-explanatory: using GLMakie import Makie # type hierarchy abstract type G end struct G1 \<: G end struct G2 \<: G end # define recipe for vector of G Makie.@recipe(MyPlot, gs) do scene Makie.Attributes(…

---

## [Makie: Calculation on Observables?](https://discourse.julialang.org/t/makie-calculation-on-observables/135099)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 2\
**Last updated:** [January 17, 2026, 6:41am UTC](https://discourse.julialang.org/t/makie-calculation-on-observables/135099 "2026-01-17T06:41:37Z")

</div>

I have a relatively complicated function to produce values and a relatively complicated function to plot the values. The combination already works to produce a still image. Now, I want to produce an animation changing a…

---

## [Makie scatter plot update issues](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284)

<div class="topic-metadata">

**Author:** [@Barabule](https://discourse.julialang.org/u/Barabule)\
**Replies:** 2\
**Last updated:** [December 2, 2025, 9:25pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284 "2025-12-02T21:25:42Z")

</div>

Hi, I’m trying to make a GLMakie GUI with a draggable scatter plot. The dragging part works OK (it updated the positions), but when modifying the number of points plotted, the scatter plot only shows the initial number …

---

## [Figure dashboard with Bonito and WGLMakie](https://discourse.julialang.org/t/figure-dashboard-with-bonito-and-wglmakie/133387)

<div class="topic-metadata">

**Author:** [@gdestouet](https://discourse.julialang.org/u/gdestouet)\
**Replies:** 4\
**Last updated:** [November 5, 2025, 1:37pm UTC](https://discourse.julialang.org/t/figure-dashboard-with-bonito-and-wglmakie/133387 "2025-11-05T13:37:56Z")

</div>

Hello everyone, I am currently trying to set up a dashboard of figures using the following code using Bonito using WGLMakie all\_figs = Dict() function newfig(title) fig = Figure() if title in keys(all\_figs) all…

---

## [Optimization of the use of observables and globals in Makie (from script to @main function)](https://discourse.julialang.org/t/optimization-of-the-use-of-observables-and-globals-in-makie-from-script-to-main-function/124258)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 3\
**Last updated:** [December 29, 2024, 8:54pm UTC](https://discourse.julialang.org/t/optimization-of-the-use-of-observables-and-globals-in-makie-from-script-to-main-function/124258 "2024-12-29T20:54:33Z")

</div>

I am trying to make my Makie GUI run faster and allocate less. I have just upgraded to Julia 1.11.2 and thought it was a good opportunity to use function (@main) in other words, wrap all my global scope code into a funct…

---

## [Makie observable lift functions](https://discourse.julialang.org/t/makie-observable-lift-functions/121202)

<div class="topic-metadata">

**Author:** [@Andy2K11](https://discourse.julialang.org/u/Andy2K11)\
**Replies:** 5\
**Last updated:** [October 12, 2024, 6:37am UTC](https://discourse.julialang.org/t/makie-observable-lift-functions/121202 "2024-10-12T06:37:57Z")

</div>

Hi. I’ve been trying to learn how to use observables in Makie and have managed to make an interactive plot with an IntervalSlider. The xaxis ticks are controlled with a lift function: xticks = lift(ab\_slider.inte…

---

## [Update an external Observable in Makie recipe](https://discourse.julialang.org/t/update-an-external-observable-in-makie-recipe/116617)

<div class="topic-metadata">

**Author:** [@NicoD](https://discourse.julialang.org/u/NicoD)\
**Replies:** 2\
**Last updated:** [July 4, 2024, 12:17pm UTC](https://discourse.julialang.org/t/update-an-external-observable-in-makie-recipe/116617 "2024-07-04T12:17:35Z")

</div>

In Julia, an observable can be passed as argument to a function, and when the function updates its value, the changes are visible from outside the function (the observable declared outside is updated). Simple working ex…

---

## [How to use Observable to Update Multiple Updates to a GLMakie Animation](https://discourse.julialang.org/t/how-to-use-observable-to-update-multiple-updates-to-a-glmakie-animation/115255)

<div class="topic-metadata">

**Author:** [@Thushara\_Gunaratne](https://discourse.julialang.org/u/Thushara_Gunaratne)\
**Replies:** 1\
**Last updated:** [June 5, 2024, 9:04pm UTC](https://discourse.julialang.org/t/how-to-use-observable-to-update-multiple-updates-to-a-glmakie-animation/115255 "2024-06-05T21:04:44Z")

</div>

I’m trying to generate an animation with multiple observables as in the following code: using GLMakie # Define some sample data (replace with your actual data) x = range(0.0, 2.0, length=101) data1 = Observable(sin.(2\*…

---

## [Makie on(Observable) combo triggers multiple times](https://discourse.julialang.org/t/makie-on-observable-combo-triggers-multiple-times/115039)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 5\
**Last updated:** [June 1, 2024, 3:30pm UTC](https://discourse.julialang.org/t/makie-on-observable-combo-triggers-multiple-times/115039 "2024-06-01T15:30:16Z")

</div>

I made a data visualization tool with Makie where observables watch my axis.finallimits selection to update the selected indices, which then triggers the plotting. This involves two on() blocks. The problem is that it t…

---

## [How to get a coordinates of the square in a heatmap using Observables?](https://discourse.julialang.org/t/how-to-get-a-coordinates-of-the-square-in-a-heatmap-using-observables/112573)

<div class="topic-metadata">

**Author:** [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Replies:** 4\
**Last updated:** [April 24, 2024, 4:05pm UTC](https://discourse.julialang.org/t/how-to-get-a-coordinates-of-the-square-in-a-heatmap-using-observables/112573 "2024-04-24T16:05:49Z")

</div>

I have an image (or heatmap) and I want to be able to click and find x and y indexes of clicked area using Observables. How could it be possible?

---

## [Strange Makie Observable updating behavior within recipe](https://discourse.julialang.org/t/strange-makie-observable-updating-behavior-within-recipe/113225)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 4\
**Last updated:** [April 19, 2024, 11:25am UTC](https://discourse.julialang.org/t/strange-makie-observable-updating-behavior-within-recipe/113225 "2024-04-19T11:25:24Z")

</div>

Hello all, I’m currently facing a strange error while using a custom recipe. This error only showed up with recent versions of Makie, but I could not find the source. Here is the problem, for meshscatters, Makie has onl…

---

## [Problem with observables and animations](https://discourse.julialang.org/t/problem-with-observables-and-animations/112731)

<div class="topic-metadata">

**Author:** [@oddsen](https://discourse.julialang.org/u/oddsen)\
**Replies:** 2\
**Last updated:** [April 9, 2024, 2:45pm UTC](https://discourse.julialang.org/t/problem-with-observables-and-animations/112731 "2024-04-09T14:45:45Z")

</div>

Hi, Im trying to animate something with points In this code, it is supposed to show points moving for each iteration. The problem is that the points from the previous iteration aren’t being removed, resulting in an a…

---

## [How to create a string with observable values in GLMakie?](https://discourse.julialang.org/t/how-to-create-a-string-with-observable-values-in-glmakie/111525)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 7\
**Last updated:** [March 15, 2024, 12:28pm UTC](https://discourse.julialang.org/t/how-to-create-a-string-with-observable-values-in-glmakie/111525 "2024-03-15T12:28:49Z")

</div>

Hello, I am using GLMakie to make an interactive plot. I would like to make a label to a slider that shows the actual value of an observable. But how do I extract the value so that it can be rounded and displayed? In t…

---

## [Issue with Live Plotting 3D Objects using Meshes.jl, Observables, and GLMakie: Bound Error on Item Removal](https://discourse.julialang.org/t/issue-with-live-plotting-3d-objects-using-meshes-jl-observables-and-glmakie-bound-error-on-item-removal/111253)

<div class="topic-metadata">

**Author:** [@ehsani63](https://discourse.julialang.org/u/ehsani63)\
**Replies:** 3\
**Last updated:** [March 6, 2024, 7:20pm UTC](https://discourse.julialang.org/t/issue-with-live-plotting-3d-objects-using-meshes-jl-observables-and-glmakie-bound-error-on-item-removal/111253 "2024-03-06T19:20:18Z")

</div>

I’ve been exploring the use of Meshes.jl in combination with Observables and GLMakie for live plotting of 3D objects. My goal is to dynamically update a plot by adding or removing 3D objects (like Box or Ball) and visual…

---

## [GLMakie Runtime Error](https://discourse.julialang.org/t/glmakie-runtime-error/109543)

<div class="topic-metadata">

**Author:** [@Mahnoor\_Pop](https://discourse.julialang.org/u/Mahnoor_Pop)\
**Replies:** 0\
**Last updated:** [February 1, 2024, 12:38am UTC](https://discourse.julialang.org/t/glmakie-runtime-error/109543 "2024-02-01T00:38:53Z")

</div>

Hi all! I’ve created a program using GLMakie that uses sliders and buttons. Everything works when I run the script, though sometimes it can be a little laggy (I presume because I’m generating a new trajectory for a dynam…

---

## [How can I redirect the output from a function that calls \`ProgressMeter\` to an \`Observable\` variable?](https://discourse.julialang.org/t/how-can-i-redirect-the-output-from-a-function-that-calls-progressmeter-to-an-observable-variable/107092)

<div class="topic-metadata">

**Author:** [@zapiano](https://discourse.julialang.org/u/zapiano)\
**Replies:** 1\
**Last updated:** [December 4, 2023, 3:22am UTC](https://discourse.julialang.org/t/how-can-i-redirect-the-output-from-a-function-that-calls-progressmeter-to-an-observable-variable/107092 "2023-12-04T03:22:10Z")

</div>

I have a function that uses ProgressMeter. I need the output from @showprogress that is called inside that function to be redirected to an Observable. Something like the following (except that the following code doesn’t …

---

## [Makie and observables](https://discourse.julialang.org/t/makie-and-observables/105261)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 5\
**Last updated:** [October 23, 2023, 2:47pm UTC](https://discourse.julialang.org/t/makie-and-observables/105261 "2023-10-23T14:47:12Z")

</div>

Disclaimer : I’m totally unsure if this question is sound or not. In the Makie - Problems with synchronous updates documentation, it is clearly stated that multiple updates of the plots can occur when only one really is…

---

## [Customizing Makie rectangle zoom mouse interaction and axis limits](https://discourse.julialang.org/t/customizing-makie-rectangle-zoom-mouse-interaction-and-axis-limits/104448)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 8\
**Last updated:** [October 21, 2023, 3:47pm UTC](https://discourse.julialang.org/t/customizing-makie-rectangle-zoom-mouse-interaction-and-axis-limits/104448 "2023-10-21T15:47:52Z")

</div>

I am trying to create a Makie dashboard where several axes (e.g. x-y, t-z) with the same data points will update simultaneously based on the mouse selection of data in any of the axes. I made an observable, selection\[\],…

---

## [Makie on() do block does not see a variable](https://discourse.julialang.org/t/makie-on-do-block-does-not-see-a-variable/104918)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 2\
**Last updated:** [October 13, 2023, 7:58pm UTC](https://discourse.julialang.org/t/makie-on-do-block-does-not-see-a-variable/104918 "2023-10-13T19:58:44Z")

</div>

I am in this situation: on(topbutton\[4\].clicks) do click lma,lmaheader,lmafile,tim,xy,tz = load\_lma\_data(lmafolder,lmafile,1) selection\[\] = lma.qua .&& (0 .\< tim .\<= 600) end Result: Error in callback: Undef…

---

## [Select point from graph, use button to store?](https://discourse.julialang.org/t/select-point-from-graph-use-button-to-store/104323)

<div class="topic-metadata">

**Author:** [@dkzwart](https://discourse.julialang.org/u/dkzwart)\
**Replies:** 1\
**Last updated:** [September 27, 2023, 6:35pm UTC](https://discourse.julialang.org/t/select-point-from-graph-use-button-to-store/104323 "2023-09-27T18:35:40Z")

</div>

I have a plot that I want to pick a point from. Once I select the correct point, I want to press a button to store it (using PostgreSQL). Currently, when I press the ‘save’ button, it selects a different point and stores…

---

## [Lifting functions with multiple return values](https://discourse.julialang.org/t/lifting-functions-with-multiple-return-values/103821)

<div class="topic-metadata">

**Author:** [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Replies:** 1\
**Last updated:** [September 13, 2023, 9:33pm UTC](https://discourse.julialang.org/t/lifting-functions-with-multiple-return-values/103821 "2023-09-13T21:33:46Z")

</div>

I want to lift a function with multiple return values such that each return value is an observable. Below is an example which makes an observable pair, instead, as I wish, a pair of observables. julia\> z = Observable(3 …

---

## [Lifting observable draws all data from previous steps](https://discourse.julialang.org/t/lifting-observable-draws-all-data-from-previous-steps/102565)

<div class="topic-metadata">

**Author:** [@ittomsk](https://discourse.julialang.org/u/ittomsk)\
**Replies:** 0\
**Last updated:** [August 7, 2023, 2:00pm UTC](https://discourse.julialang.org/t/lifting-observable-draws-all-data-from-previous-steps/102565 "2023-08-07T14:00:33Z")

</div>

I’m using that code to draw an object with it’s orientation on top. When orientation marker spins, marker from previous step doesn’t disappear. But I want to draw only orientation from current step. How do I do it? adat…

---

## [Makie Alpha property in colormap is not observable. What's best way to mech this?](https://discourse.julialang.org/t/makie-alpha-property-in-colormap-is-not-observable-whats-best-way-to-mech-this/99731)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 6:03pm UTC](https://discourse.julialang.org/t/makie-alpha-property-in-colormap-is-not-observable-whats-best-way-to-mech-this/99731 "2023-06-01T18:03:35Z")

</div>

I have a function that makes a plot using lines/lines!. I can pass observables into the function and get the line x,y,z, and colormap value to update dynamically. The alpha value does not update as an observable. What…

---

## [GLMakie & Observables with GeometryBasis or user defined types](https://discourse.julialang.org/t/glmakie-observables-with-geometrybasis-or-user-defined-types/97851)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 2\
**Last updated:** [April 24, 2023, 11:55am UTC](https://discourse.julialang.org/t/glmakie-observables-with-geometrybasis-or-user-defined-types/97851 "2023-04-24T11:55:43Z")

</div>

Hey out there! I have a question concerning Makie and the use of Observables. Here’s what I liked to do: using GLMakie, GeometryBasics mutable struct foo{T} x::Vector{T} r::T end function makefig(foo::foo) …

---

## [Makie surface not working with Observables](https://discourse.julialang.org/t/makie-surface-not-working-with-observables/94786)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 0\
**Last updated:** [February 17, 2023, 10:37am UTC](https://discourse.julialang.org/t/makie-surface-not-working-with-observables/94786 "2023-02-17T10:37:23Z")

</div>

When I make a surface with Observables in Makie using GLMakie sep = Observable(.01) xlim = Observable(5) ylim = Observable(10) x = @lift(-$xlim:$sep:$xlim) y = @lift(-$ylim:$sep:$ylim) z = @lift(\[i\*j for i in $x, j in …

---

## [Observable function](https://discourse.julialang.org/t/observable-function/94646)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 1\
**Last updated:** [February 14, 2023, 10:24pm UTC](https://discourse.julialang.org/t/observable-function/94646 "2023-02-14T22:24:35Z")

</div>

How do Observable functions work? using GLMakie, Makie rng = Observable(range(-10,10,1000)) f = Observable((x)-\>sin(x)) g = Observable((x)-\>x) dep = @lift(Point2f.(\[($g(i), $f(i)) for i in $rng\])) rng\[\] = range(-10,5,…

---

## [How to make Makie plot react to two observales?](https://discourse.julialang.org/t/how-to-make-makie-plot-react-to-two-observales/94644)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 1\
**Last updated:** [February 14, 2023, 8:25pm UTC](https://discourse.julialang.org/t/how-to-make-makie-plot-react-to-two-observales/94644 "2023-02-14T20:25:52Z")

</div>

How can I make a Makie plot that is dependent on two observables, one variable dependent no the other, react when I change the master variable? For Instance using GLMakie, Makie x = -10.0:.1:10.0 y = Observable(x .^2)…

---

## [Update xlims in interactive GLMakie](https://discourse.julialang.org/t/update-xlims-in-interactive-glmakie/93825)

<div class="topic-metadata">

**Author:** [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Replies:** 5\
**Last updated:** [January 31, 2023, 10:49pm UTC](https://discourse.julialang.org/t/update-xlims-in-interactive-glmakie/93825 "2023-01-31T22:49:51Z")

</div>

I have the question how to make xlims and ylims update automatically when an Observable changes. For instance: x=1:10 |\> collect |\> Observable fig, ax, plt = scatter(x, @lift($x .^ 2)) fig Updating x does not lead to …

---

## [Iterate an observable](https://discourse.julialang.org/t/iterate-an-observable/89619)

<div class="topic-metadata">

**Author:** [@mgp](https://discourse.julialang.org/u/mgp)\
**Replies:** 2\
**Last updated:** [November 2, 2022, 4:47pm UTC](https://discourse.julialang.org/t/iterate-an-observable/89619 "2022-11-02T16:47:52Z")

</div>

I have an undirected simple graph and a vector of nodes that I want to colour red. The function plotg below allows this using CairoMakie, Graphs, GraphMakie function plotg(g, y) fig = Figure(); ax = Axis(fig\[1, 1\])…

[Next page](https://discourse.julialang.org/tag/observables/1181.md?match_all_tags=true&page=1&tags%5B%5D=observables)
