# Makie scatter plot of vector of points

**URL:** <https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039>\
**Category:** New to Julia\
**Created:** [June 9, 2020, 6:22am UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039 "2020-06-09T06:22:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 9, 2020, 6:22am UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/1 "2020-06-09T06:22:29Z")

</div>

I would like to pass a vector of 3D points:

```julia
v = Vector{Point3f0}(undef, 10)

```

to scatter plot. Do I have to separate it into x, y and z columns first and call:

```julia
scene = scatter(x, y, z, color = :red, markersize = 0.02)

```

or there is a simpler way?

BTW, why name the type `Point3f0` instead of `Point3f`?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [June 9, 2020, 10:27am UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/2 "2020-06-09T10:27:32Z")

</div>

> [@pauljurczak](#):
>
> why name the type `Point3f0` instead of `Point3f` ?

I think this was chosen in reference to the `f0` suffix for Float32 literals:

```julia
julia> typeof(1.2)
Float64

julia> typeof(1.2f0)
Float32

```

But I agree it’s confusing, since the `0` in `f0` is incidental… `1.2f3` is also valid syntax for a Float32. So `Point3f` would make more sense, and it is also more usual. These types are defined in [GitHub - JuliaGeometry/GeometryBasics.jl: Basic Geometry Types](https://github.com/JuliaGeometry/GeometryBasics.jl) . Maybe it would be worth filing an issue to suggest changing it.

---

<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:** [June 9, 2020, 1:13pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/3 "2020-06-09T13:13:50Z")

</div>

It should just work to pass the Vector of points to the plotting function?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [June 9, 2020, 4:45pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/4 "2020-06-09T16:45:57Z")

</div>

Issue filed at [Rename Point3f0 and similar to Point3f, etc. · Issue #61 · JuliaGeometry/GeometryBasics.jl · GitHub](https://github.com/JuliaGeometry/GeometryBasics.jl/issues/61)

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 9, 2020, 6:24pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/5 "2020-06-09T18:24:19Z")

</div>

Indeed it does:

```julia
scatter(rand(Point3f0, 10), color = :red, markersize = 0.02)

```

I’m just learning my ABCs and asking silly questions.

---

<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:** [June 9, 2020, 6:48pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/6 "2020-06-09T18:48:14Z")

</div>

No worries, I was just wondering given the way you phrased the question whether you had encountered a bug

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [June 10, 2020, 4:01pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/7 "2020-06-10T16:01:09Z")

</div>

> [@jules](#):
>
> It should just work to pass the Vector of points to the plotting function?

Out of curiosity, how did you know this would work? I can’t find any example using this syntax… I would have tried `scatter([x y z])` (which fails) but wouldn’t have guessed `scatter(Point3f0.(x,y,z))`). It also seems hard to find it by reading [https://makie.juliaplots.org/stable/signatures.html](https://makie.juliaplots.org/stable/signatures.html)…

---

<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:** [June 10, 2020, 4:15pm UTC](https://discourse.julialang.org/t/makie-scatter-plot-of-vector-of-points/41039/8 "2020-06-10T16:15:21Z")

</div>

I’ve been using Makie for a while, so I just knew. But I don’t know if it’s explicitly mentioned in the docs somewhere
