attempt to change the axis of an axes limits remove the original image

1 visualización (últimos 30 días)
Hello, I created GUI with several axis and pushing buttons. I loaded binary image to specific axes (let call it axes1). now i would like to change the image axis so it will be tight on the image and than plot on the image afterwards.
now i've been noticed that if i tried to change the image axis the image remove (the axes area turns gray). this is my code:
axes(handles.axes1)
imageAxes1 = imshow(temp_struct.binary_image);
axis([xmin xmax ymin ymax]);
hold on
and from some reason it doesn't work. there are any specific rule for changing axis in GUI? by the way i am using the guide for building the gui.
Thanks.
  1 comentario
dpb
dpb el 11 de Mayo de 2014
Editada: dpb el 11 de Mayo de 2014
I don't have the toolbox so I don't know just what the image object is, precisely, but I wonder if by first creating an axes object then the image object you don't have dueling axes wherein you've changed the limits on the current handle graphics object which is axes1 rather than for the image object axes. The grayout to me implies this that you've made that background axes now the foreground so it's masking the image.
Again, I don't have the Toolbox so can't test, but I'd suggest you dispense with the call to axes and use imshow and it's handle and properties exclusively.
IA has been around this AM, he's the expert; maybe he'll notice this and have the definitive answer altho I suspect it's at least related to the above altho that may not be the optimum solution. (Besides not having the toolbox, I don't do GUIs.)

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 11 de Mayo de 2014
Editada: Image Analyst el 12 de Mayo de 2014
I'd just do this:
axes(handles.axes1)
imshow(temp_struct.binary_image);
axis on; % Or off.
hold on
You can set axis limits with xlim() and ylim() though I don't know why you'd do that, and I'm not sure you can, if you've displayed an image first.
  2 comentarios
daniel
daniel el 12 de Mayo de 2014
Great! i dont know why but the line:
axis on;
fix the issue Thanks again!
Image Analyst
Image Analyst el 12 de Mayo de 2014
Not sure either, but it's what I always do. I never do what you did first, though it may be allowed, so I'm not familiar with when that way of calling it should be used. Glad it worked though.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by