3D scatter plot with 4D data

前提是你 提交于 2019-11-28 02:23:23

So just use z for the size vector (4th input) as well as the color vector (5th input):

z = 10*(1:pi/50:10*pi);
y = z.*sin(z/10);
x = z.*cos(z/10);

figure(1)
scatter3(x,y,z,z,z)

view(45,10)
colorbar

The size vector needs to be greater 0, so you may need to adjust your z accordingly.

You are already nearly there... simply use

scatter3(X,Y,Z,s,W);

where s is the point size (scalar, e.g. 3) and W is a vector with your W values. You might also want to issue an

set(gcf, 'Renderer','OpenGL');

where gcf gets your current figure you are plotting in to significantly increase responsiveness when scattering a lot of data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!