Question about axes using GUI in MATLAB
古いコメントを表示
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 件のコメント
Salaheddin Hosseinzadeh
2014 年 8 月 26 日
Try not turning off the axis
axis off
I don't think if that's the correct way of disappearing the axis.
Angelina
2014 年 8 月 26 日
Ben11
2014 年 8 月 26 日
Are all of your images the same size?
Angelina
2014 年 8 月 26 日
Michael Haderlein
2014 年 8 月 26 日
編集済み: Michael Haderlein
2014 年 8 月 26 日
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
2014 年 8 月 26 日
Michael Haderlein
2014 年 8 月 26 日
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
2014 年 8 月 26 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!