SUBFIGURE Create figure in tiled positions.
1) subfigure(m,n,p) move gcf to the position specified by m,n,p in a same
manner as subplot(m,n,p) does, p is a scalar or vector.
2) subfigure(m,n,p,figure) create a new figure at the specified position.
3) subfigure(m,n,p,f) when f is a figure will move f to the specified position.
4) subfigure(...,P1,V1,P2,V2...) sets the specified property-value pairs on the figure.
OUT: hFig - Handle of figure.
!! NOTE1: 'maximize' function is required!
http://mathworks.com/matlabcentral/fileexchange/25471-maximize
NOTE2: you may add extra line to 'maximize' function:
warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
in order to get rid of warning message.
Enjoy!
Nikolay (2021). subfigure(nRows,nCols,figureId,varargin) (https://www.mathworks.com/matlabcentral/fileexchange/53225-subfigure-nrows-ncols-figureid-varargin), MATLAB Central File Exchange. Retrieved .
Inspired by: maximize
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
for those who feels ok to use global variables - you may consider a small improvement by the replacement:
maximize(hFig)
pause(0.1)
s=get(hFig,'outerposition');
with
global fullscreensize
if isempty(fullscreensize)
maximize(hFig)
pause(0.1)
fullscreensize=get(hFig,'outerposition');
end
s=fullscreensize;
Here is a dummy code for the cover picture. try it:
N=6;
color=lines(N);
for k=1:N-1
m=2^floor(k/2);
n=2^ceil(k/2);
p=2^k-2^(k/2*(1-rem(k,2)));
subfigure(m,n,p,figure,'color',color(k,:),'menubar','none')
str=sprintf('subfigure(%g,%g,%g)',m,n,p);
uicontrol('style','text','string',str,'fontsize',22,'units','normalized','position',[0 0.4 1 0.2],'backgroundcolor',color(k,:))
end
subfigure(m,n,2^k,figure,'color',color(end,:),'menubar','none')
str=sprintf('subfigure(%g,%g,%g)',m,n,2^k);
uicontrol('style','text','string',str,'fontsize',22,'units','normalized','position',[0 0.4 1 0.2],'backgroundcolor',color(N,:))