File Exchange

image thumbnail


version (6.08 KB) by Luca Amerio
Creates a new tabbed figure window or adds a new tab to an existing one.


Updated 20 Oct 2017

View Version History

View License

TABBEDFIGURE creates a new tabbed figure window or adds a new tab to an existing
AX = TABBEDFIGURE(H,TABNAME) creates new axes in a tab with title 'TabName'
inside the figure H and returns its handle.
If TABNAME is a character cell-array of length N, N new tabs are
created, each with name TABNAME{i}
[AX,TAB] = TABBEDFIGURE(_) returns both the handle of the axes and the
parent tab.
Right-clicking on a tab's label or anywhere inside, it's possible to:
* RENAME current tab
* CLOSE current tab
* COPY current tab to a new standalone figure (The tab name is
setted both as name and tag of the new figure)
* COPY ALL TABS to new standalone figures (The tab name of each tab is
setted both as name and tag of each new figure)
* SAVE current tab as a standalone figure in a .fig file
* SAVE ALL TABS as standalone figures in .fig files
By Luca Amerio

Cite As

Luca Amerio (2021). tabbedFigure(parentFig,tabName,source) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Michael Walsh

Here's an answer to my question. There may be a better way, but this way works. In this example, FIG is a handle to a figure with existing tabs. I then add a tab called 'a_new_tab' and raise it to the top so that anything added to its axes is immediately visible withou having to mouse click on the tab:

c = get(FIG, 'children');
x = get(c, 'type');
k = find(strcmp(x, 'uitabgroup');
y = get(c(k), 'children');
[new_axis, new_tab] = tabbedFigure(FIG, 'a_new_tab');
set(c(k), 'selectedtab', new_tab);

Michael Walsh

Terrific contribution. However, I'd like to be able to "raise" an old tab when I add something to its axes. Has anyone figured out how to do this?


MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!