Code covered by the BSD License  

Highlights from
Precise Figure Placing

4.5

4.5 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 120.33 KB File ID: #19646
image thumbnail

Precise Figure Placing

by Markus Buehren

 

20 Apr 2008 (Updated 11 Apr 2011)

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

| 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)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
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...).

19 Apr 2011 Jiro Doke

Nice tool. I can see it being very useful when working with many figures. Is there a reason why you didn't put all the helper functions in subfunctions? You can have fewer files for easy file management.

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

Documentation updated.

12 Aug 2008

Bug fixed.

02 Oct 2008

Bug fixed.

11 Apr 2011

Only E-mail changed in html documentation.

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

Contact us at files@mathworks.com