tightly_SubPlot
function tightly_SubPlot(m,n,scale,edge,name,type)
% m as row num
% n as col num
% scale as axis size of each subplot, use to adjust distance between subplot
% edge as the distance from the coordinate axis from subplot [m row,1st col] to the
% lower and left
% name use for save figure
% type as formate of figure
% ShiYu 2020-8-21
% note : manual by user to adjust axis size and position of subplot
if nargin == 5
type = 'pdf';
elseif nargin == 4
type = 'pdf';
name='sample';
elseif nargin == 3
type = 'pdf';
name='sample';
edge=0.05;
elseif nargin == 2
type = 'pdf';
name='sample';
edge=0.05;
scale=0.7;
end
figure('Color',[1 1 1]);
X_length=1-edge;
Y_length=1-edge;
xsize=X_length/n;
ysize=Y_length/m;
for x=1:m
for y=1:n
h=axes('Position',[xsize*(y-1)+edge 1-ysize*x scale*xsize scale*ysize]);
end
end
saveas(gca,name,type);
end
Zitieren als
yu shi (2026). tightly_SubPlot (https://de.mathworks.com/matlabcentral/fileexchange/79391-tightly_subplot), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxTags
Quellenangaben
Inspiriert: Remove White Space,Make Subplot Tight
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.2 | some correct of note |
||
| 1.0.1 | new example figure |
||
| 1.0.0 |
