I have many points in 3d (x,y,z), and for each point I have it's disparity (0-10 value), different points can have the same disparity.
I want to plot this data that each point will have a color according to it's disparity.
I want it to be something like this picture: (small disparity will have one color, and as it's gets bigger the color changes)

how can I do it?
Use scatter3:
x = rand(1,1000);
y = rand(1,1000);
z = rand(1,1000); %// example x, y, z
d = x.^2+y.^2+z.^2; %// example disparity
scatter3(x,y,z,8,d,'fill');
colorbar
The fourth input argument to scatter3 is marker size. The fifth determines color. 'fill' uses filled markers.

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