hey everyone.how should I plot these data in maltba???? as long as every row's data with specific number shoud have specific color.
for example : the datas with rows number 10 should have same color
the datas with rows number 9 should have same color
......
an excel file is attached.

 採用された回答

KSSV
KSSV 2019 年 5 月 24 日

0 投票

data = xlsread('Book1.xlsx') ;
x = data(:,1) ;
y = data(:,2) ;
plot(x, y); % a basic monochrome plot
% Trick surface into a 2-D plot
surface('XData', [x x], ... % N.B. XYZC Data must have at least 2 cols
'YData', [y y], ...
'ZData', zeros(numel(x),2), ...
'CData', [y y], ...
'FaceColor', 'none', ...
'EdgeColor', 'interp', ...
'Marker', 'none');

5 件のコメント

marc
marc 2019 年 5 月 24 日
Thank you very much. What if I want to just show the second column with specific colors for clusters.the numbers from 1 to 10 are clusters. Actually I don't want them as graph, I want like a picture
KSSV
KSSV 2019 年 5 月 24 日
Like pciture?
marc
marc 2019 年 5 月 24 日
i mean i want the dots to be clear to see like this PartitionDataIntoTwoClustersExample_02.png
KSSV
KSSV 2019 年 5 月 24 日
If you have columns of (x,y) and group column, use gscatter. Read about it.
marc
marc 2019 年 5 月 24 日
ok.thanks a lot

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2019 年 5 月 24 日

コメント済み:

2019 年 5 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by