I've got a function that assigns a real value to every point in space. How can I visualize it on some bounded volume?
To extend Peter's suggestion in the comments ^^:
use scatter3 with setting the cdata
parameter:
% generating some sample data
[x,y,z]=sphere(50);
x=x(:);y=y(:);z=z(:);
% the interesting stuff:
h=scatter3(x,y,z);
gives you
To add coloring, do the following:
set(h,'cdata',z)
or immediately:
scatter3(x,y,z,'cdata',z);
which results in
Here the color vector is just the z value, but it can be anything (as long as it's the same size as x (and y and z).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With