Syntax 3-D Scatter Plot Color as a Function of Altitude
7 ビュー (過去 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)...
the end result needs to look something like this: http://qhwiki.originlab.com/~originla/howto/images/a/a8/Tutorial_3DSurfaceMap_0.png
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
0 件のコメント
採用された回答
Walter Roberson
2011 年 5 月 9 日
dotsize = 6; %adjust as needed
scatter3(x1(:), y1(:), z1(:), dotsize, z1(:), 'filled');
3 件のコメント
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 Center および File Exchange で Colormaps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!