raiseFigure - Intuitive alternative to figure(h) command

버전 1.0.0.0 (2.3 KB) 작성자: Thomas Clark
Identifies figures by Title (or tag), not by figure number
다운로드 수: 402
업데이트 날짜: 2010/9/18

라이선스 보기

This is really simple, so many people will use this functionality already, but I just thought I'd make it a bit easier for everyone (and include rigorous error checking while I'm at it)...

raiseFigure can be used to replace MATLAB's
fh = figure() and
figure(h)
commands where a user wishes to identify a figure by it's title name (and tag), rather than by it's handle.

This is useful in cases where the same figure needs to be accessed by multiple workspaces.

For example, a function (which is called multiple times) updates a figure each time (replotting some data, say). There are many ways to do this, but typically, the plot must be initialised before the first function call, then the figure handle passed during each function call.

Instead, raiseFigure('FigTitle') can be used within the function call (instead of figure() ). Each time that function is executed, it'll either create or make current the same figure (which has the title 'FigTitle')

The 'Tag' property of MATLAB figures is used, so you can change the displayed figure Name if you like.

Background:
I coded this because I had some functions with figure numbers hard-coded. So I'd call figure(801) (or whatever number) and each time the function was called, it'd plot into figure 801. Of course, sooner or later I used the same number twice and got into a massive mess!

인용 양식

Thomas Clark (2025). raiseFigure - Intuitive alternative to figure(h) command (https://www.mathworks.com/matlabcentral/fileexchange/28754-raisefigure-intuitive-alternative-to-figure-h-command), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2009a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0