5.0

5.0 | 1 rating Rate this file 11 downloads (last 30 days) File Size: 119.96 KB File ID: #19646

Precise Figure Placing

by Markus Buehren

 

20 Apr 2008 (Updated 02 Oct 2008)

Code covered by BSD License  

This contribution provides functions for precisely placing a figure to a given screen location.

Download Now | Watch this File

File Information
Description

This contribution provides functions for precisely placing a figure to a given screen location, like the upper left corner, the top half of the screen or the full screen. The figure is placed precisely adjacent to the screen borders and will not overlap the task bar at the screen bottom. In order to achieve this, the left and right borders of a figure as well as the height of the figure head, the menu bar etc. are obtained by analyzing a screen shot of a test figure.

Example 1:
fh = figure;
placefigure(fh, 'top left');

Example 2:
fh1 = figure;
fh2 = figure;
fh3 = figure;
fh4 = figure;
placefigure(fh1, [2 2 1 1]);
placefigure(fh2, [2 2 1 2]);
placefigure(fh3, [2 2 2 1]);
placefigure(fh4, [2 2 2 2]);

Run function placefiguredemo.m to start a demonstration of the capabilities of this package.

Known issues:

* The retrieval of the task bar height is expected to work only if the task bar is at the bottom of the screen. Further, the analysis of a screen shot is not extremely fail-safe. If it fails on your machine, please let me know.

* This package does not work under Octave, as the root/figure properties are different.

MATLAB release MATLAB 7.4 (R2007a)
Zip File Content  
HTML Files placefigure.html
Other Files
computefiguresizeinfo.m,
correctfigpos.m,
deletefiguresizeinfo.m,
getfiguresizeinfo.m,
gethostname.m,
getplatform.m,
getscreensizeinpixels.m,
getscreensizeinpixelspc.c,
getscreensizeinpixelspc.m,
getusername.m,
placefigure.m,
placefiguredemo.m,
screenshot.png,
tempdir2.m,
textwrap2.m,
yesnoinput.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
30 May 2008 Andrea Soldan

it works correctly and i think that it is useful in a lot of simulation job (i've often think about a way to place pictures where i've preferred...).

Please login to add a comment or rating.
Updates
22 Apr 2008

Documentation updated.

12 Aug 2008

Bug fixed.

02 Oct 2008

Bug fixed.

Tag Activity for this File
Tag Applied By Date/Time
annotation Markus Buehren 22 Oct 2008 09:58:29
customization Markus Buehren 22 Oct 2008 09:58:29
figure Markus Buehren 22 Oct 2008 09:58:29
window Markus Buehren 22 Oct 2008 09:58:29
placing Markus Buehren 22 Oct 2008 09:58:29
task bar Markus Buehren 22 Oct 2008 09:58:29
screen Markus Buehren 22 Oct 2008 09:58:29
screen size Markus Buehren 22 Oct 2008 09:58:29
border Markus Buehren 22 Oct 2008 09:58:29
figure Dazhi Jiang 15 Feb 2009 20:11:57
customization Dazhi Jiang 15 Feb 2009 20:12:00
 

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