creating a 3d sphere scatter plot in mathgl using a datafile
I'm trying to create a 3d scatter plot with spheres us开发者_Go百科ing a data file of the format:
X Y Z val \n 0 0 0 1 \n 0 0 1 0 \n 0 0 2 0 \n 0 0 3 0 \n . . .
I can read the file but I can't seem to find any where how to plot a set of spheres using matrix
(my goal is to get something like this)
P.S.
If any of you know how to get the same plot using gnuplot or any other command line/script file tool I'll be happy.
Just draw spheres in the cycle.
for(long i=0;i<n;i++)
gr->Sphere(mglPoint(x[i],y[i],z[i]),r[i]);
精彩评论