how to name points in a plot?
Mostrar comentarios más antiguos
Hello,
i am interested in naming points of my plot wiht numbers. So i tried it the following way where i is the number that should describe my node.
for i=1:length(xk)
plot(xk(i),yk(i),sprintf( '#%i'))
i=i+1;
hold on
end
but it didnt work and this error occured:
--->??? Error using ==> plot
--->Error in color/linetype argument
--->Error in ==> Plotten at 51
---> plot(xk(i),yk(i),sprintf( '#%i'))
can anyone help me with that please?
with best regards, John
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 10 de Mayo de 2013
Editada: Azzi Abdelmalek
el 10 de Mayo de 2013
for i=1:length(xk)
text(xk(i),yk(i),num2str(i))
hold on
end
1 comentario
Sushree Patra
el 8 de Dic. de 2018
Without for loop how to provide the numbering to each point.
Means if
x1= 167*rand (50,1);
y1=302* rand (50,1);
plot(x1,y1,'b*');
Categorías
Más información sobre Line Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!