hold on is not working?

I need to plot an image (using pcolor). On this image, the user has to select 2 points, which then have to be visualized. This is what I have so far:
%plot image
figure(1); pcolor(filtered); colormap(gray); shading interp; axis off; title('title'); axis equal tight;
%get input
hold on
[x_in(1),y_in(1)] = ginput(1);
p1 = plot(x_in(1),y_in(1),'b.');
set(p1, 'Markersize',15);
[x_in(2),y_in(2)] = ginput(1);
p2 = plot(x_in(2),y_in(2),'g.');
set(p2, 'Markersize',15);
hold off
Only problem: the points are not showing...what am i doing wrong?

 Respuesta aceptada

Image Analyst
Image Analyst el 28 de Feb. de 2013

0 votos

It's because you used pcolor for some reason. Use image() or imshow() and it will work fine. Is there some reason why you wanted to use pcolor (which rmeoves a row and column of your data) rather than a normal image display function?

1 comentario

Bart
Bart el 28 de Feb. de 2013
Thank you for your response.
I already tried the image(), but it doesnt work with my data.
After flipping my data using flipud(), the imshow() works! only have to set the range.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Exploration en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Feb. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by