- On Windows systems, the size of the Command Window fonts and Editor fonts might
be larger than in previous releases. In particular, you might see a difference if you
have nondefault font sizes selected in MATLAB preferences. You might need to adjust
those font sizes to make them look smaller. - You might see differences on multiple-display systems that include a combination of
different displays (for example, some, but not all of the displays are high-DPI).
Graphical elements might look different across displays on those systems.
Using Object Properties
These changes to object properties minimize the impact on your existing code and allow
MATLAB to use the full display resolution when rendering graphical elements. All UIs you
create in MATLAB are automatically DPI-aware applications.
Units Property
When you set the Units property of a graphics or UI object to 'pixels', the size of each
pixel is now device-independent on Windows and Macintosh systems:
- On Windows systems, 1 pixel = 1/96 inch.
- On Macintosh systems, 1 pixel = 1/72 inch.
- On Linux systems, the size of a pixel is determined by the display DPI.
Your existing graphics and UI code will continue to function properly with the new pixel
size. Keep in mind that specifying (or querying) the size and location of an object in pixels
might not correspond to the actual pixels on your screen.
For example, each screen pixel on a 192-DPI Windows system is 1/192nd of an inch. In
this case, twice as many screen pixels cover the same linear distance as the device-
independent pixels do. If you create a figure, and specify its size to be 500-by-400 pixels,
MATLAB reports the size to be 500-by-400 in the Position property. However, the
display uses 1000-by-800 screen pixels to cover the same graphical region.
NoteStarting in R2015b, MATLAB might report the size and location of objects as
fractional values (in pixel units) more frequently than in previous releases. For example,
your code might report fractional values in the Position property of a figure, whereas
previous releases reported whole numbers for that same figure.
9 Lay Out a Programmatic UI