File Exchange

image thumbnail

TabPlot

version 1.1.0.0 (4.73 KB) by Joseph Kirk
Uses tabs to display multiple plots in a single figure

0 Downloads

Updated 18 Aug 2016

View License

TABPLOT Add multiple plots to a single figure separated by tabs

Author:
Joseph Kirk
jdkirk630@gmail.com

Date: 08/16/16

Description: Uses tabs to display multiple plots in a single figure.

Inputs:
tabName - (optional) string specifying the name to use for the tab
hFig - (optional) handle to the desired figure (default = gcf)
tabLoc - (optional) string specifying the location of the tabs
must be one of {'top','bottom','left','right'}
tabColor - (optional) value specifying the background color of the tab

Outputs:
hAx - (optional) handle of the axes created for the new tab
hTab - (optional) handle of the new tab
hTabGroup - (optional) handle of the entire tab group

Usage:
tabplot
-or-
tabplot('Tab Name')
-or-
tabplot('Tab Name',hFig)
-or-
tabplot('Tab Name',hFig,tabLoc)
-or-
tabplot('Tab Name',hFig,tabColor)
-or-
hAx = tabplot( ... )
-or-
[hAx,hTab] = tabplot( ... )
-or-
[hAx,hTab,hTabGroup] = tabplot( ... )

Example:
% Open a new figure and create 2 tabs with plots
figure;
tabplot;
imagesc(peaks);
tabplot;
mesh(peaks);

Example:
% Open a new figure and create 2 *named* tabs with plots
hFig = figure;
tabplot('Peaks Image',hFig);
imagesc(peaks);
tabplot('Peaks Mesh',hFig);
mesh(peaks);

Example:
% Open a new figure and create 2 tabs that appear on the top
hFig = figure;
tabplot('Peaks Image',hFig,'top');
imagesc(peaks);
tabplot('Peaks Mesh',hFig);
mesh(peaks);

Example:
% Test case where figure already has graphics (generates prompt)
figure;
mesh(peaks);
tabplot;
imagesc(peaks);

Example:
% Delete tabgroup from figure
figure;
tabplot;
imagesc(peaks);
title('Tab group will be deleted in 3 seconds')
pause(3)
[~,~,hTabGroup] = tabplot;
delete(hTabGroup)

Comments and Ratings (0)

Updates

1.1.0.0

Updated description.

1.1.0.0

Added option to set the tab location and background color

1.0.0.0

Updated description

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor