Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visualizing 3d data volume in matlab

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)

enter image description here

how can I do it?

like image 875
Shai Zarzewski Avatar asked Jan 21 '26 16:01

Shai Zarzewski


1 Answers

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.

enter image description here

like image 188
Luis Mendo Avatar answered Jan 23 '26 20:01

Luis Mendo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!