Reputation: 110
Simple Problem, I have a data set with x-,y-,z-coordinates and the volume of each sphere. Should be enough data to plot these spheres? Isn't it?
I'm new to Julia and I actually have no clue how to do this. Couldn't find any similar and helpful answer...
Thank you, Tom
Upvotes: 4
Views: 1259
Reputation: 20248
I think Makie would be a good option. The documentation for meshscatter gives an example that can be adapted to better fit what you'd like to achieve:
using Makie
x = 100*rand(10)
y = 100*rand(10)
z = 100*rand(10)
scene = meshscatter(x, y, z, markersize = 10, color = :white)
Makie.save("plot.png", scene)
Upvotes: 3
Reputation: 42214
Another option is PyPlot:
using PyPlot
N = 32
u = range(0, stop=2π, length=N)
v = range(0, stop=π, length=N)
x = cos.(u) .* sin.(v)'
y = sin.(u) .* sin.(v)'
z = repeat(cos.(v)',outer=[N, 1])
PyPlot.surf(x,y,z)
PyPlot.savefig("plot.png")
Upvotes: 2