3D plotting packages

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

Looks so professional! I want to fold that!

A solution in pure Makie:

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)

and to show each color with a cube:

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

1 Like

@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.

@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. You should be able to display all the spheres with individual colors, like I did for the cubes above.

@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.