File Exchange

image thumbnail

tabbedFigure(parent​Fig,tabName,source)

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

1 Download

Updated 20 Oct 2017

View License

TABBEDFIGURE creates a new tabbed figure window or adds a new tab to an existing
one.
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
Example:
f=figure;
ax=tabbedFigure(f,'test);
plot(1:10,randn(1,10));
By Luca Amerio
luca.amerio@polimi.it
28/01/2016

Cite As

Luca Amerio (2020). tabbedFigure(parentFig,tabName,source) (https://www.mathworks.com/matlabcentral/fileexchange/55138-tabbedfigure-parentfig-tabname-source), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

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);

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?

chong

Updates

1.1.0.0

Minor updates

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