Plotting 3D with points id.

1 回表示 (過去 30 日間)
sermet
sermet 2014 年 2 月 2 日
編集済み: Azzi Abdelmalek 2014 年 2 月 2 日
%I have 4 points with x y z coordinates and their names.
point_id=[n1,n2,n3,n4]
x=[100,115,120,130]
y=[250,267,288,310]
z=[50,54,68,72]
%I wanna plot 3D view for these points with their ids. I mean I need to see each points with their names w.r.t the coordinate system.

採用された回答

Walter Roberson
Walter Roberson 2014 年 2 月 2 日
point_id={'n1', 'n2', 'n3', 'n4'};
x=[100,115,120,130]
y=[250,267,288,310]
z=[50,54,68,72]
scatter3(x, y, z, 'b*');
text(x, y, z, point_id); %do this after the plotting or labels will not show up

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 2 日
編集済み: Azzi Abdelmalek 2014 年 2 月 2 日
point_id={'n1','n2','n3','n4'}
x=[100,115,120,130]
y=[250,267,288,310]
z=[50,54,68,72]
scatter3(x,y,z)
for k=1:numel(x)
text(x(k),y(k),z(k),point_id{k})
end

カテゴリ

Help Center および File ExchangeLog Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by