add data points to a graph

hi i have a matlab figure, and i'd like to highlight some important points on it, could anybody help me? tnx in advance

 Respuesta aceptada

David Sanchez
David Sanchez el 25 de Sept. de 2013

0 votos

Select the "Data Cursor" on the figure window and click on the point you want.
Hold "alt" to multiple selection.

2 comentarios

Youssef  Khmou
Youssef Khmou el 25 de Sept. de 2013
Good answer,
maryam
maryam el 26 de Sept. de 2013
It really helps. thank you very much

Iniciar sesión para comentar.

Más respuestas (2)

Youssef  Khmou
Youssef Khmou el 25 de Sept. de 2013
Editada: Youssef Khmou el 25 de Sept. de 2013

1 voto

you have to know the xy coordinates of those points to mark them . suppose i have a graph Y(X) :
X=1:10;Y=randn(1,10);
plot(X,Y), hold on,
Marked=[X(2) Y(2); X(4) Y(4)];
plot(Marked(:,1),Marked(:,2),'o');

1 comentario

maryam
maryam el 26 de Sept. de 2013
tnx for ur answer,but i dont know the xy coordinates,just a figure.

Iniciar sesión para comentar.

Harsh
Harsh el 18 de Oct. de 2021

1 voto

folowing is an example where i have highlited a point with red airstrike
function m = plot_cos(y, t)
plot(t,y,'b--')
hold on
[iminy,idy]=min(y);
plot(idy,iminy,'r*')
hold off
m=min(y);
end

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 25 de Sept. de 2013

Respondida:

el 18 de Oct. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by