|
|
| File Information |
| Description |
Finds and activates, or creates, figure with user-specified name.
If no name is provided, creates figure named "untitledn" (where n is incremented to result in a unique name).
SYNTAX:
togglefig('My Figure');
If figure named 'My Figure' exists, it will be activated (brought to the front and shown). Otherwise, it will be created.
h = togglefig('My Figure');
Also returns the handle to the specified or created figure.
togglefig;
Creates and activates new figure named untitled1, untitled2, ...
Note: You can subsequently activate these figures with, for instance, togglefig('untitled1').
OTHER EXAMPLES:
NOTE: This example requires the Image Processing Toolbox
im = imread('cameraman.tif');
for ii = 1:10
thresh = ii/20;
togglefig('Threshold');
imshow(im2bw(im,thresh));
title(sprintf('Threshold = %0.2f',thresh));
pause(1)
end
Motivation:
I've found this to be exceptionally useful in algorith-development
mode, particularly when iterating on cells in the cell-mode editor. (I
use this function in almost every mfile I write these days.) |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Zip File Content |
|
| Other Files |
license.txt, togglefig.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (7) |
| 04 Jan 2008 |
John D'Errico
|
|
|
| 10 Jan 2008 |
Brett Shoelson
|
|
|
| 10 Jan 2008 |
Brett Shoelson
|
|
|
| 10 Jan 2008 |
John D'Errico
|
|
|
| 17 Oct 2008 |
victor de lafuente
|
|
|
| 23 Jun 2009 |
Danilo
|
|
|
| 26 Jun 2009 |
Brett Shoelson
|
|
|
| Updates |
| 10 Jan 2008 |
Minor modification to suppress handle generation if no output is requested. |
| 06 Jan 2009 |
I added a new (optional) input argument that triggers a CLF (clear-figure) command. |
| 26 Jun 2009 |
Fixes a bug when togglefig is called with no input arguments. Thanks to Danilo for pointing it out! |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com