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