Question about axes using GUI in MATLAB
Mostrar comentarios más antiguos
I have a GUI with one object: axes and a pushbutton. When pressing the pushbutton, I would like to display on the axes several images. I tried to use subplots but it doesn’t seem to cope: the images go all over the GUI window and not just where the axes are.
Here is the code for my pushbutton:
axes(handles.ManyImage);
subplot(2,2,1);
RGB1 = imread('Image1.TIF');
imagesc(RGB1);
axis off
subplot(2,2,2);
RGB2 = imread('Image2.TIF');
imagesc(RGB2);
axis off
subplot(2,2,3);
RGB3 = imread('Image3.TIF');
imagesc(RGB3);
axis off
I attached the illustrations of my problem.
Thank you for the help!
8 comentarios
Salaheddin Hosseinzadeh
el 26 de Ag. de 2014
Try not turning off the axis
axis off
I don't think if that's the correct way of disappearing the axis.
Angelina
el 26 de Ag. de 2014
Ben11
el 26 de Ag. de 2014
Are all of your images the same size?
Angelina
el 26 de Ag. de 2014
Michael Haderlein
el 26 de Ag. de 2014
Editada: Michael Haderlein
el 26 de Ag. de 2014
Subplots are individual axes. You just created subplots (axes) on top of the first axes. They overlap, but they are not connected to each other. If you want axes inside a container, you can create a uipanel object and set the parent property of the axes (subplots) to the uipanel handle. As the positions are normalized by default, you can then just set the panel's position and the axis will follow.
Angelina
el 26 de Ag. de 2014
Michael Haderlein
el 26 de Ag. de 2014
Yes, as far as I got your request, you want to have multiple images displayed but the axes should not be distributed all over the figure. Then create the uipanel, put it where you want, and put one axes per image into this panel.
Angelina
el 26 de Ag. de 2014
Respuesta aceptada
Más respuestas (0)
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!