window for several figures.

MATLAB Version: 9.4.0.813654 (R2018a), running under MacOS 10.13.6. I run a script that computes 3 figures. This produces 3 thumbnails. When I click on the thumbnails one by one, they open into a window entitled Figures. I get 3 tabs, labelled Figure 1, Figure 2 and Figure 3. I want to avoid the step "click on them". Instead I want to go directly to the final stage described. Here is an mwe, with any three image matrices:
clearvars;
close all;
load('test.mat');
figure; imshow(img);
figure; imshow(f_img);
figure; imshow(sq_img);

回答(1 个)

Just creating figures with images in axes on them won't popup another figure with tabs in it when you click on any of the images, unless you set up a callback to do that when you clicked on the image. This doesn't do that:
clearvars;
close all;
% load('test.mat');
img = imread('peppers.png');
f_img = imread('onion.png');
sq_img = imread('cameraman.tif');
figure; imshow(img);
figure; imshow(f_img);
figure; imshow(sq_img);
Are you sure you're showing us ALL the code? If so, attach 'test.mat' and a screenshot.

4 个评论

Thanks for the code which gave me very similar results to those I reported in my original question. answers1.png is a screen shot of the way the screen looks after running your code. answers2.png is the result of manually dragging the three thumbnails to display them separately. answers3.png is the result of clicking on the little curved arrow at the upper right of each of the three thumbnails. I'm not quite sure what I would like the program to do to make it more convenient to view the output, but, at the very least I have to avoid clicking on lots of thumbnails in order to get good views. I tried commands like figure(2), but that just reproduced the thumbnail, not a full-size image. I'm wondering if the reason Image Analyst and I get such different results from the same code is that Image Analyst is using a much bigger screen than the one on my laptop.
I forgot to ask. How can I get the path of a file like "peppers.png"?
>> folder = fileparts(which('peppers.png')) % Determine folder where image lives.
thanks. I didn't think of that. In Unix "which" works on commands only, not on filenames. It seems that, if a file is on the Matlab path, then "which" will find it, which is very useful.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by