File Exchange

image thumbnail


version (3.31 KB) by Julian Hapke
neatly tiles figures over all available monitors


Updated 27 May 2021

View Version History

View License

In a nutshell: An updated Version of for HG2 and multi-monitor-support
Automatically detects the usable desktop space and figure borders for overlap-free arrangements.

Cite As

Julian Hapke (2021). tilefigs (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

Julian Hapke

@Jason, I was wondering why this would happen, because I already added a branch for maximizing the figure in newer versions.
Turns out, I created a bug, that was hidden by the try catch. I fixed it now.

Jason Stockton

Thank you for the work you put into this. So far it looks good and should be super helpful.
Found one issue (soon to be an issue...). Looks like the JavaFrame property will be going away.
I am using MATLAB R2019a on Windows 10.

I received this Warning:
Warning: figure JavaFrame property will be obsoleted in a future release. For more information see the JavaFrame resource on the MathWorks web site.
> In tilefigs2>maximize (line 185)
In tilefigs2 (line 63)

Julian Hapke

@Johannes, that feature was introduced in R2018b, the maximize submission was updated to use WindowState, but I also incorporated the essential lines from that submission into tilefigs. so one does not need to download another submission as well.

Johannes Hougaard

neat function and quite easy to manoeuvre with the comments in the code.
I subbed line 62 as I didn't feel the need for your 'maximize' function when it was only used to determine size of maximized window.

It was easily replaced by
f.WindowState = 'maximized';

which is in my opinion a neat implementation by Mathworks to maximize a window.


Error at line 107:
pos = [...
usable(figonmon,1) + (col' - 1) .* width(figonmon) ...
usable(figonmon,2) + (nrows - row') .* height(figonmon) ...
width(figonmon) ...
height(figonmon) ...
Error using horzcat
Dimensions of arrays being concatenated are not consistent.

Fixed by changing to:
pos = [...
usable(figonmon(:),1) + (col' - 1) .* width(figonmon(:)) ...
usable(figonmon(:),2) + (nrows - row') .* height(figonmon(:)) ...
width(figonmon(:)) ...
height(figonmon(:)) ...


Ah, see now that maximize is listed as a requirement! Ignore last message

Julian Hapke

@jkr sorry to hear, unfortunately I do not have access to any device with mac os for testing, on Windows 7 it works fine with Matlab 2018a.


Did not work at all for me. Of 6 open figures, it minimizes 4 on one screen, 2 on the other.
Running R2018a (9.4...) 64 bit on an iMac with two monitors.

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

Inspired by: tilefigs.m, maximize

Community Treasure Hunt

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

Start Hunting!