matlab - Set colormap on scatter3 plot -


i plotting depth image (rgbd) scatter graph, using scatter3(x,y,z) in matlab.

how can set colormap on scatter3 plot color dependent on z-value?

thanks

do want 3d-visuasation?

then use scatter3 follows:

scatter3(x,y,z,[],z) 

where [] can number specifying size of circles, otherwise default 36 used.

if want use z definition color, use simple scatter

scatter(x,y,[],z) 

you can set colormap usual:

colormap(hot) 

example:

[x,y,z] = sphere(16); x = [0.5*x(:); 0.75*x(:); x(:)]; y = [0.5*y(:); 0.75*y(:); y(:)]; z = [0.5*z(:); 0.75*z(:); z(:)];  scatter3(x,y,z,[],z) colormap(hot) 

enter image description here

more information in documentation.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -