フィルターのクリア

rank the point in scatter3d figure with different color

1 回表示 (過去 30 日間)
HONG CHENG
HONG CHENG 2017 年 4 月 11 日
回答済み: HONG CHENG 2017 年 4 月 11 日
Dear everyone,
I want to draw a figure with 3-d data (x,y,values),and I want to rank the values then the different ranks value are with different color as you can see from figure2.
Anyone know the answer?Thanks in advance.
Hong Cheng

採用された回答

HONG CHENG
HONG CHENG 2017 年 4 月 11 日
Now I have find a easy and beautiful method to do this
scatter3(locationX,locationY,RSSValue, 'CData',RSSValue);
just with 'CData',RSSValue parameters, we can do this

その他の回答 (2 件)

KSSV
KSSV 2017 年 4 月 11 日
編集済み: KSSV 2017 年 4 月 11 日
x = rand(100,1) ;
y = rand(100,1) ;
z = rand(100,1) ;
%%get indices according to values
idx = 1:100 ;
idx1 = z >0. & z<=0.4 ;
idx2 = z >0.5 & z<=0.8 ;
idx3 = z >0.8 & z<=1 ;
%%plot
figure
hold on
scatter3(x(idx1),y(idx1),z(idx1),'r','filled')
scatter3(x(idx2),y(idx2),z(idx2),'b','filled')
scatter3(x(idx3),y(idx3),z(idx3),'g','filled')
  1 件のコメント
HONG CHENG
HONG CHENG 2017 年 4 月 11 日
thanks for your answer. I think the result is right. And it looks nice nut not enough. can I ask one more question about this? the question is as you can see this link https://cn.mathworks.com/matlabcentral/answers/334739-rank-the-point-in-scatter3d-figure-with-different-color#answer_262568

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


HONG CHENG
HONG CHENG 2017 年 4 月 11 日
And I can edit the figure with the "MATLAB figure editer"
function createfigure(locationX1, locationY1, RSSValue1, S1, RSSValue2)
%CREATEFIGURE(LOCATIONX1, LOCATIONY1, RSSVALUE1, S1, RSSVALUE2)
% LOCATIONX1: scatter3 x
% LOCATIONY1: scatter3 y
% RSSVALUE1: scatter3 z
% S1: scatter3 s
% RSSVALUE2: scatter3 c
I think we should use something like the S1 as the parameter of the scatter3 function

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by