Code covered by the BSD License  

Highlights from
maximize

4.33333

4.3 | 9 ratings Rate this file 25 Downloads (last 30 days) File Size: 1.24 KB File ID: #25471

maximize

by Oliver Woodford

 

02 Oct 2009 (Updated 17 May 2010)

Platform independent function to maximize a figure window.

| Watch this File

File Information
Description

This function maximizes MATLAB figures on any platform. It takes a figure handle as input. Note: it doesn't simply resize the figure to fill the screen.

It uses Java, therefore doesn't contain any mex or OS specific code.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (13)
18 Apr 2010 Sherif Elnabarawy

i am wondering why all this code and functions for this simple thing , just need to maximize the gui automatically when loading , all codes and functions didn't work perfectly with me , any help ?
thanks a lot,
Sherif Elnabarawy.

19 Apr 2010 Oliver Woodford

Sherif: I've tested this function under several different versions of Matlab and OS's, and it works fine on all of them. If it genuinely doesn't work for you then can I suggest you send me a much more detailed bug report (e.g. Matlab version & OS, error message etc.) via the Contact Author link on my Author page. Posting requests for help here isn't what this comments section is for.

21 Apr 2010 Carsten Hoever  
14 May 2010 JdW

Exactly what I whas looking for. I always did resizing to fill the screen, but this works so much nicer.

17 May 2010 Heinrich Acker

It's nice to have a real maximize operation without rezising, calling executables or the like. There is one issue, however:

If there is no figure, 'maximize' causes exceptions and makes all subsequent figure or plot operations fail, until the graphic system is sort of reset, e.g. by 'close all'. Tested on R2007b.

18 May 2010 Heinrich Acker  
10 Jun 2010 JdW

I encounter one issue using your maximize.m function, namely maximize throws exceptions when figure is not yet ready. I include an example:

Example that throws exceptions:
h = figure; maximize(h);

Not so nice looking solution:
h = figure; pause(0.01); maximize(h);

10 Jun 2010 Oliver Woodford

Joris: On the version of MATLAB I have I don't see this error with the latest version of maximize (updated 17th May 2010). Do you have the latest version? It specifically fixed the error you report.

15 Nov 2010 Craig

Worked very nicely for me on Win7 with 64-bit R2010b. I use it together with export_fig to automatically and consitently save high quality figure output.

Many thanks Oliver!

15 Jan 2011 Mohammed El-Said

Works great,
Thanks for sharing...

08 Jun 2011 Julián Francisco

Hi. Your application does not work if the visibility of the figure is off before
calling the mazimize function. I am trying to find a function that maximize the figure window through a smoothed optical transition. Thank you for your attention. Best regards.

26 Oct 2011 Lukas  
16 Dec 2011 Joao Henriques

Works as advertised, thank you!

Please login to add a comment or rating.
Updates
13 May 2010

Removed dependency on jFindobj, using an idea based on comments by Yair Altman on the newsgroup.

17 May 2010

Fix bug reported by Heinrich Acker (thanks!).

Tag Activity for this File
Tag Applied By Date/Time
maximize Oliver Woodford 02 Oct 2009 11:41:40
figure Oliver Woodford 02 Oct 2009 11:41:40
maximize figure Oliver Woodford 02 Oct 2009 11:41:40
maximise Oliver Woodford 02 Oct 2009 11:41:40
fullscreen Oliver Woodford 02 Oct 2009 11:41:40
window Oliver Woodford 02 Oct 2009 11:41:40

Contact us at files@mathworks.com