3.5

3.5 | 2 ratings Rate this file 7 downloads (last 30 days) File Size: 2.65 KB File ID: #21958

Set Figure to Screen

by Robert M. Flight

 

31 Oct 2008 (Updated 20 May 2009)

Code covered by the BSD License  

Useful for defining default figure locations on multiple monitors

Download Now | Watch this File

File Information
Description

Like to use multiple monitors? Don't like Matlab default figure behavior for multiple monitors? This function allows one to define which monitor figures will be drawn on by default. It also allows one to set the default position based on monitor, or a previously drawn figure. This means you can even set the default position to fill an entire monitor!

Examples:
  set_figure_toscreen(a)
     Where 'a' is numeric, either a monitor number (1, 2, 3, 4) or a figure handle.
  set_figure_toscreen(opt,a)
     Where opt is a string, either 'mon' to use a monitor, or 'fig' to
     use a figure handle. a should be either a monitor number (if using 'mon') or a figure handle (if using 'fig').

MATLAB release MATLAB 7.6 (R2008a)
Other requirements Only tested on Windows XP, no idea about behavior for Linux or Mac systems.
Zip File Content  
Other Files license.txt,
set_figure_toscreen.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
02 Nov 2008 B. Roossien

It does have help, although it does not contain an H1 line. An H1 line allows you to find your function with 'lookfor' when you have forgotten the exact function name.

The code has a weird order of execution making it harder to read. Furthermore, the M-lint brings up a number of improvements, some of them which are critical (use && instead of &)

17 Feb 2009 Fang Jin

this doesn't work on Mac or linux machine due to the reference to a com.mathworks object in the code. Is there possible you can redefine the thing just by the monitor position. thank you

20 May 2009 Robert M. Flight

If someone could test on Linux or Mac and inform me of behavior, that would be great. If it behaves unexpectedly, please send me a screenshot of the result, the command you gave, describe how your monitors are set up, and the output of the command: "get(0,'MonitorPositions')".

Please login to add a comment or rating.
Updates
03 Nov 2008

As suggested, added an H1 line and corrected the logical conditions.

03 Nov 2008

Reorganized into two sections, decision making based on input and actual calculations to change figure position in order to make the function more readable by users. Functionality is unchanged.

20 May 2009

Removed the use of a Java COM object specific to PC systems in order to make it more general, as well as the ability to set default based on the Matlab position.

Tag Activity for this File
Tag Applied By Date/Time
root position Robert M. Flight 01 Nov 2008 03:08:13
multiple monitor Robert M. Flight 01 Nov 2008 03:08:13
figure position Robert M. Flight 01 Nov 2008 03:08:13
position Robert M. Flight 01 Nov 2008 03:08:13
figure Robert M. Flight 01 Nov 2008 03:08:13
monitor Robert M. Flight 01 Nov 2008 03:08:13
screen Robert M. Flight 01 Nov 2008 03:08:13
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com