# Makie scatter plot update issues

**URL:** <https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284>\
**Category:** General Usage\
**Tags:** makie, observables\
**Created:** [December 2, 2025, 10:43am UTC](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284 "2025-12-02T10:43:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barabule](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Barabule](https://discourse.julialang.org/u/Barabule)\
**Post date:** [December 2, 2025, 10:43am UTC](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284/1 "2025-12-02T10:43:02Z")

</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 of points.  
Here is an illustration of the problem, after pressing ‘a’ a few times to add more points, the scatter plot is not updated properly (number of markers stay the same). The line plot works fine.

```julia-auto
using GLMakie, Observables

function minimal_gui()

    fig = Figure()
    ax = Axis(fig[1,1])

    PTS = Observable(rand(Point2f, 5))

    lines!(ax, PTS, color = :grey)

    # my_markers = @lift map(i -> isodd(i) ? :circle : :diamond, eachindex($PTS))
    my_markers = lift(PTS) do pts

        [isodd(i) ? :circle : :diamond for i in eachindex(pts)]
    end

    scatter!(ax, PTS, marker = my_markers, markersize = 10)

    on(events(ax).keyboardbutton, priority = 10) do event
        if event.action == Keyboard.press && event.key == Keyboard.a
            
            pts = PTS[]
            push!(pts, rand(Point2f))
            PTS[] = pts
            
        return Consume(true)
        end
        return Consume(false)
    end

    return fig
end

```

This is how it looks:

 ![bad](https://global.discourse-cdn.com/julialang/original/3X/a/f/afd62db5643f6f55a1ec8f9a2188b18691ef3ac3.png)

I also tried doing something like this (delete & recreate the plot when PTS changes):

```julia-auto
scatter_plot = Observable(scatter!(ax, PTS, ...)) 
scatter_plot = lift(PTS) do pts
    delete!(ax, scatter_plot[]
    markers = ...
  sizes = ...
  scatter!(ax, ...)
end

```

This works, but resets the zoom level EVERY TIME I drag the points, which is very annoying. I’m  
fine with either method if it can be made to work without these weird issues.

Many thanks!

---

<div class="post-metadata">

**Author:** ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)\
**Post date:** [December 2, 2025, 2:39pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284/2 "2025-12-02T14:39:40Z")

</div>

This a bug where a computation down the line checks wrong input for changes. Until we merge and release a fix, you can add

```julia
...
PTS[] = pts

s.font = "Fira Mono"
s.font = "default"

return Consume(true)

```

to the callback. That will mark the checked input as changed.

Fixed in [Fix `marker` updates not propagating in `scatter` by ffreyer · Pull Request #5451 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/pull/5451)

---

<div class="post-metadata">

**Author:** ![Barabule](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Barabule](https://discourse.julialang.org/u/Barabule)\
**Post date:** [December 2, 2025, 9:25pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-update-issues/134284/3 "2025-12-02T21:25:42Z")

</div>

Unfortunately this didn’t work. I got a very long error …

But I found a relatively simple workaround, just make separate scatter plots for each group:

```julia-auto
using GLMakie, Observables

function minimal_gui()

    fig = Figure()
    ax = Axis(fig[1,1])

    PTS = Observable(rand(Point2f, 5))

    lines!(ax, PTS, color = :grey)

    pts_even = lift(PTS) do pts
        ids = filter(i -> iseven(i), eachindex(pts))
        pts[ids]
    end

    pts_odd = lift(PTS) do pts
        ids = filter(i -> isodd(i), eachindex(pts))
        pts[ids]
    end

    
    scatter!(ax, pts_even, marker = :circle, markersize = 40)
    scatter!(ax, pts_odd, marker = :diamond, markersize = 40)

    on(events(ax).keyboardbutton, priority = 10) do event
        if event.action == Keyboard.press && event.key == Keyboard.a
            
            pts = PTS[]
            push!(pts, rand(Point2f))
            PTS[] = pts
            
        return Consume(true)
        end
        return Consume(false)
    end

    return fig
end

```

This updates correctly, but it’s more typing.  
I’m looking forward for the fix, thanks.
