File Exchange

image thumbnail

subfigure(nRows,nCo​ls,figureId,varargi​n)

version 1.0.0.0 (1.83 KB) by Nikolay
Create figure in tiled positions

0 Downloads

Updated 18 Nov 2015

View License

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!

Comments and Ratings (2)

Nikolay

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;

Nikolay

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,:))

Updates

1.0.0.0

'fullscreensize' variable moved to 'persistent' workspace instead of 'global'.

1.0.0.0

now works properly also with OS X

1.0.0.0

cover picture

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Acknowledgements

Inspired by: maximize