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

조회 수: 4 (최근 30일)
Ian Wood
Ian Wood 2011년 5월 9일
댓글: Ebrahim Hesami 2021년 2월 10일
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
Bruno Aravena Pérez
Bruno Aravena Pérez 2020년 12월 23일
Exactly what I was looking for, I am grateful.
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에서 Orange에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by