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.

 Respuesta aceptada

KSSV
KSSV el 24 de Mayo de 2019

0 votos

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 comentarios

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Mayo de 2019

Comentada:

el 24 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by