Visualization of 3D data in Matlab

I have many points in 3d (x, y, z) and for each point I have its mismatch (value 0-10), different points may have the same mismatch.

I want to plot this data so that each point has a color according to its mismatch.

I want it to be something like this picture: (a slight discrepancy will have one color and as it gets bigger the color changes)

enter image description here

How can i do this?

+3


source to share


1 answer


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 scatter3

is the size of the marker. The fifth determines the color. 'fill'

uses filled markers.

enter image description here

+4


source







All Articles