Distribute figures

version 1.17.0.0 (548 KB) by Anders Simonsen
This function can distribute figures on different parts of the screen(s).

2.7K Downloads

Updated 31 Mar 2015

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Are you tired of moving your figures around to see them all? This function does it all for you! It can distribute in all parts of the screen, include Simulink figures or not and a whole lot more! It also supports secondary monitor(s) where the figures can be distributed.
>>>> A sample image can be found here: http://oi60.tinypic.com/9amydc.jpg <<<<<
The function calls needed to distribute in the shown pattern above is only:

distFig('Pos','NW','Only',1);
distFig('Pos','SW','Cols',3,'Only',(2:4));
distFig('Pos','NE','Rows',2,'Only',5);
distFig('Pos','NE','Rows',2,'Cols',2,'Only',[6,7],'Offset',2,'transpose',true);
distFig('Pos','SE','Rows',2,'Cols',4,'Only',(8:11));
distFig('Pos','SE','Rows',3,'Cols',2,'Not',(1:11),'Offset',3);

(Don't worry - it looks complicated, but by executing distFig(); the figures will also be nicely distributed. :) ) Also, there are two tutorials included to guide you through the various features.

The function supports all resolutions (also different resolutions on different monitors). It has been made using MATLAB 2015a and will thus not work properly for version 2014a and previous due to the changes in the figure handle system in version 2014b a newer releases.

The function also detects new updates automatically, but this feature is very beta, so it might contain bugs. It can easily be disabled without affecting the function, if it causes problems. Please report any errors encountered with the function. :)

Syntax:

distFig(...,'Screen',Value)
distFig(...,'Position',Value)

distFig(...,'Rows',Value)
distFig(...,'Columns',Value)

distFig(...,'Not',Value)
distFig(...,'Only',Value)
distFig(...,'Offset',Value)

distFig(...,'Adjust',Value)
distFig(...,'Extra',Value)
distFig(...,'Menu',Value)
distFig(...,'Transpose',Value)
distFig(...,'Simulink',Value)
distFig(...,'Tight',Value)
distFig(...,'Scale',Value)
distFig(...,'ScaleOrigin',Value)
distFig(...,'FreezeSize',Value)
distFig(...,'Order',Value)

Description:

distFig(...,'Screen',Value) assigns where the figures will be distributed. Synonyms for 'Screen' are 'Scr' and 'S'. Value can be:
'C' / 'Center' (Default)
'W' / 'West' / 'L' / 'Left'
'E' / 'East' / 'R' / 'Right'
'N' / 'North' / 'T' / 'Top'
'S' / 'South' / 'B' / 'Bottom'
'Main' / 'Primary'
'Ext' / 'External' / 'Secondary'

distFig(...,'Position',Value) assigns in which part of the screen the figures will be distributed. Synonyms for 'Position' are 'Pos' and 'P'. Value can be:
'C' / 'Center' (Default)
'W' / 'West' / 'L' / 'Left'
'E' / 'East' / 'R' / 'Right'
'N' / 'North' / 'T' / 'Top'
'S' / 'South' / 'B' / 'Bottom'
'NW'
'NE'
'SW'
'SE'

distFig(...,'Rows',Value) assigns how many rows the figures will be distributed on. Synonyms for 'Rows' are 'R'. Value can be:
1...n
'Auto' / -1
'Auto' indicates that it automatically calculates the number of required rows.

distFig(...,'Columns',Value) assigns how many rows the figures will be distributed on. Synonyms for 'Columns' are 'Cols' and 'C'. Value can be:
1...n
'Auto' / -1
'Auto' indicates that it automatically calculates the number of required columns.

distFig(...,'Not',Value) excludes specified figures from the distribution list. Value must be an array with the excluded figure numbers. The default value is []. The input argument 'gcf' (get current figure) can be used as well.

distFig(...,'Only',Value) does only distribute specified figures. Value must be an array with the figure which will be distributed. The default value is []. The input argument 'gcf' (get current figure) can be used as well.

The remaining features are described in the file.

Cite As

Anders Simonsen (2022). Distribute figures (https://www.mathworks.com/matlabcentral/fileexchange/37176-distribute-figures), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!