Syntax 3-D Scatter Plot Color as a Function of Altitude

10 次查看(过去 30 天)
Hi all,
I have been working on a program that plots a 3-D image using coordinates specified in a text file. I need to know how to apply colors to the scatter3 plot as a function of altitude. I have tried:
colormap(option)... colormap option... set(gca,'ColorOrder',option)...
and here is my syntax:
scatter3(x1,y1,z1,'filled'); title('Motor Cylinder'); colormap(jet); colorbar;
xlabel('length'); ylabel('width'); zlabel('height');
Can anybody tell me what I am doing wrong, and how I can fix it?
Thanks, Ian

采纳的回答

Walter Roberson
Walter Roberson 2011-5-9
dotsize = 6; %adjust as needed
scatter3(x1(:), y1(:), z1(:), dotsize, z1(:), 'filled');
  3 个评论
Ebrahim Hesami
Ebrahim Hesami 2021-2-10
Thanks for the solusion! i have applied for the 2D scatter with X and Y for the location of each point and used the hight of each point to make color map. works very well!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by