# 3D plotting packages

**URL:** <https://discourse.julialang.org/t/3d-plotting-packages/75445>\
**Category:** New to Julia\
**Tags:** plotting, mesh\
**Created:** [January 30, 2022, 3:17am UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445 "2022-01-30T03:17:36Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![RickandMortyforever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rickandmortyforever/32/33304_2.png) [@RickandMortyforever](https://discourse.julialang.org/u/RickandMortyforever)\
**Post date:** [January 31, 2022, 5:02am UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/21 "2022-01-31T05:02:56Z")

</div>

I didn’t know that Plots can do this ! So interesting! 😄

---

<div class="post-metadata">

**Author:** ![RickandMortyforever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rickandmortyforever/32/33304_2.png) [@RickandMortyforever](https://discourse.julialang.org/u/RickandMortyforever)\
**Post date:** [January 31, 2022, 5:04am UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/22 "2022-01-31T05:04:57Z")

</div>

Looks so professional! I want to fold that!

---

<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:** [January 31, 2022, 10:15am UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/23 "2022-01-31T10:15:58Z")

</div>

A solution in pure Makie:

```julia
using GLMakie

data = ((i, j, k, RGBf(i, j, k)) for i in 0:0.1:1,
                                     j in 0:0.1:1,
                                     k in 0:0.1:1)

x, y, z, color = (vec(getindex.(data, i)) for i in 1:4)

meshscatter(x, y, z; color)

```

 ![spheres](https://global.discourse-cdn.com/julialang/original/3X/d/7/d7d655c62771120011afba7c371c4ee146e3f238.jpeg)

and to show each color with a cube:

```julia
meshscatter(x, y, z; color, marker=Rect3((0,0,0), (1,1,1)))

```

 ![cubes](https://global.discourse-cdn.com/julialang/original/3X/b/2/b2f387cc89613401f4cd2855c65684cc4488817b.png)

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [January 31, 2022, 1:03pm UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/24 "2022-01-31T13:03:35Z")

</div>

@rafael.guerra, that is awesome. Is it possible to have only the vertices of the boxes displayed as small circles (no boxes in)? I looked at the plotly documentation, but I am missing something. Thanks.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 31, 2022, 1:57pm UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/25 "2022-01-31T13:57:41Z")

</div>

@VivMendes, the end result looks good but the PlotlyJS code provided is inefficient. Maybe there is a better way, like in GLMakie, I don’t know.

If you want to stay in the realm of PlotlyJS and use similar code, you can take a look at [this SO post](https://stackoverflow.com/a/35821700/14071775). You should be able to display all the spheres with individual colors, like I did for the cubes above.

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [January 31, 2022, 2:05pm UTC](https://discourse.julialang.org/t/3d-plotting-packages/75445/26 "2022-01-31T14:05:47Z")

</div>

@rafael.guerra, I was trying to keep it under the PlotlyJS package. I think I can do it with the PGFPlotsX package if I find a raw LaTeX code that does the job in pgfplots. Thanks a lot.

[Previous page](https://discourse.julialang.org/t/3d-plotting-packages/75445.md?page=1)
