how should i plot these data?

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.

 Accepted Answer

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 Comments

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
Like pciture?
i mean i want the dots to be clear to see like this PartitionDataIntoTwoClustersExample_02.png
If you have columns of (x,y) and group column, use gscatter. Read about it.
ok.thanks a lot

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Asked:

on 24 May 2019

Commented:

on 24 May 2019

Community Treasure Hunt

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

Start Hunting!