# Makie 3D scatter animation flow field

**URL:** https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056
**Category:** General Usage
**Tags:** plotting, makie
**Created:** [January 8, 2021, 6:33pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056 "2021-01-08T18:33:09Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [January 8, 2021, 6:33pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/1 "2021-01-08T18:33:09Z")

</div>

Hi everyone,  
I’m trying to make a particle tracking animation of a flow field with Makie. One thing I observed was an “artifact” when the scatter dots move away from the camera. Then they’re surrounded by a small white stroke, rendering many dots next to each other almost invisible to the eye. I attached a video to try to make my point. I hope it’s visible. Is there any easy way to turn this off? If a minimal working example helps, I can attach it later.

I am `using Makie` and plotting with

```julia
scene = scatter(x_,y_,z_,color=c_,markersize=10*s_[:],show_axis=true, strokewidth=0)

```

where `x_,y_,z_,c_` are `Node`’s that modify the `scene` for the animation.

![ezgif.com-gif-maker](https://global.discourse-cdn.com/julialang/original/3X/e/b/ebc351feeedec7b8c0442dec523588e6bf1be659.webp)

---

<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: [January 8, 2021, 6:48pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/2 "2021-01-08T18:48:58Z")

</div>

Nice plot!  
I think you pretty much have two options right now:

1. use meshscatter(shading=false) so it looks like flat circles (will be slower but should be still plenty fast)
2. use `transparency=true`… but that may introduce other artifacts like particles in the background rendering over particles in the foreground (it assumes that everything is transparent, so if it’s opaque it doesn’t work that well).

---

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [January 8, 2021, 7:15pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/3 "2021-01-08T19:15:00Z")

</div>

Thanks for the super quick reply!

Option 1 gave a

```julia
ERROR: There was no `AbstractPlotting.convert_arguments` overload found for
the plot type Combined{AbstractPlotting.meshscatter,Tuple{}}, or its conversion trait AbstractPlotting.PointBased().
The arguments were:
()

To fix this, define `AbstractPlotting.convert_arguments(::Combined{AbstractPlotting.meshscatter,Tuple{}}, )`.

```

I’m using `[537997a7] AbstractPlotting v0.12.18, [ee78f7c6] Makie v0.11.1` and Julia v1.5.2.

Option 2 works fine, but it does show the particles in the background over those in the foreground, as you said !

Is there something I can do to change this?

---

<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: [January 9, 2021, 12:32pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/4 "2021-01-09T12:32:27Z")

</div>

It looks like you call meshscatter without any arguments?

---

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [January 9, 2021, 4:39pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/5 "2021-01-09T16:39:09Z")

</div>

ah oups, I thought `meshscatter` is a configurating function 😅

It works fine now, thanks a lot!

---

<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: [January 9, 2021, 7:23pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/6 "2021-01-09T19:23:57Z")

</div>

Ah 😃  
Btw, I’d love to see the final animation, and maybe tweet it to [https://twitter.com/MakiePlots](https://twitter.com/MakiePlots) 🙂

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [December 19, 2021, 9:48am UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/7 "2021-12-19T09:48:09Z")

</div>

I also want to do a transient animation, how did you get this to work in Makie?

I was using meshscatter, but could only plot one frame at a time.

Kind regards

---

<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: [December 19, 2021, 2:03pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/8 "2021-12-19T14:03:56Z")

</div>

What do you mean?

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [December 19, 2021, 4:03pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/9 "2021-12-19T16:03:44Z")

</div>

Sorry I tried replying to @fgerick

I was just curious of how to make an animation as he showed and do it properly, i.e. not calling meshscatter all the times, but updating the underlying data if it makes sense?

I see now that he also used scatter instead of meshscatter, so perhaps that is the difference

Kind regards

---

<div class="post-metadata">

### Author: ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)
#### Post date: [December 19, 2021, 4:20pm UTC](https://discourse.julialang.org/t/makie-3d-scatter-animation-flow-field/53056/10 "2021-12-19T16:20:45Z")

</div>

Hi, I use `Node`s to udpate the plot, something like so:

```julia
r = [Node{Vector{Point3{Float64}}}(Point3.(rand(3)) for i=1:n_points]
meshcatter!(scene, r)

for i=1:n_time
    r[] = r[] .+ [Point3.(randn(3)/20) for i=1:n_points] #updates the Node
    sleep(0.02) #give the plot some time to display.
end

```

hope this helps!
