Scaled figure class
Updated 30 Dec 2016
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.
Daniel Dolan (2023). Scaled figure class (https://www.mathworks.com/matlabcentral/fileexchange/60953-scaled-figure-class), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.