Scaled figure class

Accurate graphic sizing when ScreenPixelsPerInch is not available
162 Downloads
Updated 30 Dec 2016

View License

This class is a workaround for MATLAB release 2015b and later where ScreenPixelsPerInch is a read-only property. In earlier releases, accurate physical sizing could be achieved by setting this property to the effect dots per inch (DPI) value of one's display. Doing so meant that a 4" x 4" figure was displayed exactly as four inches on each side. The loss of ScreenPixelsPerInch has two critical impacts:
1. Publication figures are harder to adjust because there is a disconnect between what one sees on the screen versus what is printed to a file.
2. Text and uicontrol labels can be *very* hard to read.
These problems are particularly acute on high resolution monitors, such as Retina displays. Mac users face an extra penalty because the MATLAB defaults to 72 DPI, even though the actual setting can be twice as large.
To use this class, create a MATLAB figure with everything you want inside: uipanels, axes, uicontrols, etc. Once the figure is complete, pass its handle to the ScaledFigure class to generate new/revised figure that is correctly sized on the screen and prints to vector/bitmap files at the same size.

Cite As

Daniel Dolan (2024). Scaled figure class (https://www.mathworks.com/matlabcentral/fileexchange/60953-scaled-figure-class), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Migrate GUIDE Apps in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0

Revised the description for clarity.