Re: [問題] plot3? draw color to a 3d data set已回收

看板MATLAB作者 ( :)時間14年前 (2009/11/14 11:38), 編輯推噓1(106)
留言7則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《facebooker (face book is my fav)》之銘言: : Hi, : 各位好 : 我有一筆資料data, 其size為 3*1000 : 既有1000個在三維空間的點 : 又有另一個vector,size為1*1000 : 它代表這1000個點上的一個函數 : 我試著用plot3(data(1,:),data(2,:),data(3,:),'.')可以把這筆data在三維空間中的分 : 布畫出 : 但我找不到適當的方法將vector以顏色表示 : 例如當函數在第某個點值小時用紅色表示,值大時用藍色表示 : 我也試過想用surf,但因為這data是randn產生出來的,所以我也不知道如何製造mesh : 可否請神人指教一下? : 謝謝大家的幫忙 : ps http://www.wretch.cc/album/show.php?i=jacinthamie&b=6&f=1257029110&p=0 : that's the result I'd like to have...thanks. :) 不知道你是不是要畫這種圖呢=.=a A = randn(3,1000); B = sum(A(1:3,:)); % B is a function of A m = median(B); plot3(A(1,(B>m)),A(2,(B>m)),A(3,(B>m)),'.b'); hold on; plot3(A(1,(B<m)),A(2,(B<m)),A(3,(B<m)),'*r'); hold on; plot3(A(1,(B==m)),A(2,(B==m)),A(3,(B==m)),'+b'); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.70.172.242

11/14 14:17, , 1F
Thanks. But this is not exactly what I want. :)
11/14 14:17, 1F

11/14 14:17, , 2F
what I want can be found in the link.
11/14 14:17, 2F

11/14 14:17, , 3F
I can partially solve it by using scatter3, but
11/14 14:17, 3F

11/14 14:18, , 4F
the result is not ideals, since you can see the
11/14 14:18, 4F

11/14 14:18, , 5F
opposite points, for example, an uniform sample
11/14 14:18, 5F

11/14 14:19, , 6F
over sphere. I hope I can get the figure like that
11/14 14:19, 6F

11/14 14:19, , 7F
in the link. Something like "surf"....thanks again
11/14 14:19, 7F
文章代碼(AID): #1A_YP9_9 (MATLAB)
文章代碼(AID): #1A_YP9_9 (MATLAB)