I would like to ask the community for help in creating a Matlab-like 3D surf plot with a colormap but in Mathematica. To make the question more specific lets say that we have a set of numbers in 3D space and to each point some function value c is asigned:
{{x1,y1,z1,c1},{x2,y2,z2,c2},...,{xN,yN,zN,cN}}
These points lay on a surface in 3D e.g. a sphere. Now in matlab if these points are properly represented as matrixes X
, Y
, Z
, C
we can simpliy plot this surface with
k = 5;
n = 2^k-1;
[x,y,z] = sphere(n);
c = magic(2^k);
surf(x,y,z,c);
colormap gray
axis equal
What is important here are the function values which can be read of the plot thanks to the colorbar.
Now the question to the community is:
Can we produce such a plot in Mathematica (with a colorbar - this is the important part)???
I searched for a solution on the web without luck. I looked at things like ListPlot3D
, ListSurfacePlot3D
, ListPointPlot3D
but to these functions you can only pass a surface without the corresponding point values (unless there is something I don't understand).
Does anyone know a solution, a way to create such plots in Wolfram Mathematica?