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.

 Réponse acceptée

KSSV
KSSV le 24 Mai 2019

0 votes

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 commentaires

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Tags

Question posée :

le 24 Mai 2019

Commenté :

le 24 Mai 2019

Community Treasure Hunt

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

Start Hunting!

Translated by