gridSubplot
GRIDSUBPLOT build a figure with subplots given by an figures vector.
Only axes are copied.
F = GRIDSUBPLOT(FIG_VECTOR) build a figure F with with subplot given
by the figures in FIG_VECTOR. There is just one axes per figure
(legends is also copy to the subplots figures).
- FIG_VECTOR: vector of the handles to the figure objects.
[...] = GRIDSUBPLOT(OUTERPOSITION_FIG, ...) - OUTERPOSITION_FIG is the
size and location of the return figure (default the entire screen).
[...] = GRIDSUBPLOT(..., NUMFIL, NUMCOL) - set the figures into a
NUMFIL-by-NUMCOL subplot.
COPYAXES function version 1.1 (December 2011) is included.
url: http://www.mathworks.com/matlabcentral/fileexchange/34314-copyaxes
EXAMPLE: Six figures are plotted into a figure with 2x3 subplot. The
result figure takes up all the screen.
numFigures = 6;
ax_list = NaN .* ones(1, numFigures);
x = 1:0.1:2*pi;
for i=1:numFigures
fig_list(i) = figure;
plot(x, sin(i*x));
title(['case ',num2str(i)])%
if (i==2) || (i==3)
xlabel('xlabel');
end
if (i==2) ||(i==4)
ylabel('ylabel');
end
lg(i) = legend(['coef = ',num2str(i)]);
end
f = gridSubplot(fig_list, 2,3);
EXAMPLE: Six figures are plotted into a figure in a subplot. The
result figure has size and position the same as the first figure in the input vector.
numFigures = 6;
ax_list = NaN .* ones(1, numFigures);
x = 1:0.1:2*pi;
for i=1:numFigures
fig_list(i) = figure;
plot(x, sin(i*x));
title(['case ',num2str(i)])
if (i==2) || (i==3)
xlabel('xlabel');
end
if (i==2) ||(i==4)
ylabel('ylabel');
end
lg(i) = legend(['coef = ',num2str(i)]);
end
f = gridSubplot(get(fig_list(1), 'outerposition'), fig_list);
Cite As
Mar Callau-Zori (2026). gridSubplot (https://www.mathworks.com/matlabcentral/fileexchange/34326-gridsubplot), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
