How to rotate the symblo only in the 3D map

35 ビュー (過去 30 日間)
joe joe
joe joe 2013 年 2 月 7 日
コメント済み: Walter Roberson 2016 年 11 月 18 日
I want to rotate the symbol(the marker) inside the figure, how to make the marker parrallel to X-Y surface as shown in fig.2?
thanks very much in advance

採用された回答

Walter Roberson
Walter Roberson 2013 年 2 月 7 日
The closest MATLAB gets to this in the built-in facilities is that scatter3() creates markers as patch objects, which you could post-process to become discs.
You might be able to find something in the File Exchange; I do not recall having happened upon it, but I wasn't looking for it either.
  4 件のコメント
joe joe
joe joe 2013 年 2 月 8 日
thanks roberson! I would like to try it again and let you know the results later time.
Walter Roberson
Walter Roberson 2016 年 11 月 18 日
Note: this solution will not work from R2014b onward.

サインインしてコメントする。

その他の回答 (1 件)

ChristianW
ChristianW 2013 年 2 月 8 日
編集済み: ChristianW 2013 年 2 月 8 日
Here is a simple basic part.
n = 100;
X = randi(n,30,1); Y = randi(n,30,1); Z = randi(n,30,1);
r = 4; % factor for radius scale
uZ = unique(Z);
cmap = jet(length(uZ));
for i = 1:length(Z)
R = r * (mean(Z)/300 + (Z(i)-min(Z))/range(Z));
[x,y] = pol2cart(0:pi/8:2*pi,R);
z = zeros(length(x));
C = cmap(uZ==Z(i),:);
patch(x+X(i),y+Y(i),z+Z(i),C,'EdgeColor','none')
end
axis tight; box on; view(23,60)
Scaling the patches for all possible inputs isnt done here. Some manual scaling can be done with r.
  3 件のコメント
ChristianW
ChristianW 2013 年 2 月 8 日
Both true, changed/edited the code, thanks.
joe joe
joe joe 2013 年 2 月 8 日
編集済み: joe joe 2013 年 2 月 8 日
good discussion! i learned a lot from you. thanks ,Robberson and ChristianW!

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by