Skip to content

TabPlot function for MATLAB; creates a figure with axes located in uitabs.

Notifications You must be signed in to change notification settings

nmacholl/TabPlot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

TABPLOT.m

Easily plot axes into uitabs instead of using subplots or multiple figures. If you're struggling with multiple figures or large subplots then TABPLOT is for you!

TABPLOT requires MATLAB 2014b or newer.

Getting Started

TABPLOT works much like SUBPLOT; in this example TABPLOT is used to create a new figure and returns an array of axes handles, one for each tab created.

ax = tabplot(2);
t = linspace(-pi, pi, 128);
plot(ax(1), sin(t), 'LineWidth', 2, 'Color', 'blue');
plot(ax(2), cos(t), 'LineWidth', 2, 'Color', 'red');

More advanced functions are available such as specifying the tab tiles and position in the tab group.

ax = tabplot(2, 'Title', {'Sine', 'Cosine'}, 'TabLocation', 'Bottom');
t = linspace(-pi, pi, 128);
plot(ax(1), sin(t), 'LineWidth', 2, 'Color', 'blue');
plot(ax(2), cos(t), 'LineWidth', 2, 'Color', 'red');

Finally, because TABPLOT returns arrays of axes and uitab handles you can easily set properties in batch.

[ax, tabs, group] = tabplot(3, 'Title', {'Sine', 'Cosine', 'Tangent'});
t = linspace(-pi, pi, 128);
plot(ax(1), t, sin(t), 'LineWidth', 2, 'Color', 'red');
plot(ax(2), t, cos(t), 'LineWidth', 2, 'Color', 'blue');
plot(ax(3), t, tan(t), 'LineWidth', 2, 'Color', 'green');
set(ax, 'XLim', [-pi, pi]);
set(tabs, 'BackgroundColor', 'white');

About

TabPlot function for MATLAB; creates a figure with axes located in uitabs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages