addsubplot

Version 1.0.0 (2.53 KB) by Bramvg
a convenient wrapper for subplot(m,n,p) that automatically arranges subplots
18 Downloads
Updated 23 Aug 2019

View License

ADDSUBPLOT moves the existing axes to subplots and adds a new subplot

ADDSUBPLOT
ADDSUBPLOT(where)
ADDSUBPLOT(h,___)
ADDSUBPLOT(___,name,value,...)

ADDSUBPLOTS will check first if there are unused subplot positions in the
figure. If yes, a subplot will be created in that spot. Otherwise the
existing subplots will be rearranged by adding a new row or column and a
new subplot will be created.

parameters:
h = figure handle (default is current figure)
where = use 'right' or 'bottom' to specify where the new subplot should
be added. Use 'square' (default) to keep the subplots in a square
arrangement.
name,value,... = parameters will be passed to the subplot function
ax = axes handle to new subplot

example:
figure
for n = 1:25
addsubplot
plot(rand(5))
end

Cite As

Bramvg (2024). addsubplot (https://www.mathworks.com/matlabcentral/fileexchange/72509-addsubplot), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
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!
Version Published Release Notes
1.0.0