# Grouping plots to be able to overwrite them with new data

**URL:** <https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [August 31, 2023, 9:18am UTC](https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397 "2023-08-31T09:18:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)\
**Post date:** [August 31, 2023, 9:18am UTC](https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397/1 "2023-08-31T09:18:55Z")

</div>

When visualising 3D data I would like to keep some geometrical structures fixed (plotted with a series of functions `mesh!`), while to be able to overwrite a set of plots made with `lines!`, `text!`, etc. with new data. Is it possible to define a plot set that I can delete before plotting the new data?

---

<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:** [September 1, 2023, 11:57am UTC](https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397/2 "2023-09-01T11:57:50Z")

</div>

Do you have to delete them? You could also update the input observables of those plots. You can also delete with `delete!`

---

<div class="post-metadata">

**Author:** ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)\
**Post date:** [September 4, 2023, 2:46pm UTC](https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397/3 "2023-09-04T14:46:04Z")

</div>

Thanks, but I do not know how the `observables` work. Any pointer to documentation or examples?  
In my case new data comes with a variable number of `lines` and `text`. This is the reason I want to group them to issue a `delete!` of the previous data group and create new plots with the new data.

BTW, I do not even know how to use `delete!`. Perhaps is something obvious, but.  
If I do

```julia
fig = Figure(resolution=(2048,2028))
 s = LScene(fig[1,1])
...
p = lines!(s, ...)
delete!(p)

```

I get

```julia
ERROR: MethodError: no method matching delete!(::Lines{Tuple{Vector{Point{3, Float32}}}})

```

---

<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:** [September 4, 2023, 4:16pm UTC](https://discourse.julialang.org/t/grouping-plots-to-be-able-to-overwrite-them-with-new-data/103397/4 "2023-09-04T16:16:18Z")

</div>

What observables are is explained here for example [https://docs.makie.org/stable/documentation/nodes/](https://docs.makie.org/stable/documentation/nodes/)
