bugGNU Octave - Bugs: bug #49627, Incompatible...


bug #49627: Incompatible "screenpixelsperinch" property

Submitted by:  Pantxo Diribarne <pantxo>
Submitted on:  Wed 16 Nov 2016 09:37:41 PM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 16 Nov 2016 09:55:14 PM UTC, comment #1:

(also copied over from bug #45600:)

I have just realized (see bug #49612, comment #2) that also the "plain" pixelnumbers (wd and ht in commment #12 of bug #45600) will be "un-real" on modern Windows systems. The factor between the real physical pixel number, and the pixel number given by VERTZRES and HORZRES seems to get scaled by Windows via the High-DPI setting (a scaling of 200% in the case of bug #49612 under Win10). Only on my very old WinXP machine the wd and ht values are returned correctly.

In this light, I think the Matlab decision is not so bad (for Windows): to go for a fixed "dpi" resolution of 96, and let the user decide (via his Windows high-dpi setting / scaling) how "big" he wants to have his pixels.

Hartmut <hardy>
Wed 16 Nov 2016 09:37:41 PM UTC, original submission:

Copying a post from bug #45600:

Matlab seems to have adopted a fixed value of the "screenpixelsperinch" property (see [1]) for Windows and Mac platforms. Note that this makes this "pixels" unit device independent (an absolute unit).

The only reason I can see is Matlab has made the (unfortunate?) choice of fixing the default figure size in pixel units. Having pixels an absolute unit is thus a way to fix the absolute size of figures across different displays.
This also means that for ML compatibility we should follow the same route. Another good reason to do so is that, at least for Mac, Qt5 also chose device independent pixels [2].

The drawback of this approach is that it is not WYSIWYG: a figure onscreen will never have the expected physical size in inches (which is the default unit for "paperposition"). There are complaints about this regression on Matlabcentral [3].

Marking OS "any" even if on linux Matlab and Octave are compatible.

[1] https://fr.mathworks.com/help/matlab/ref/root-properties.html
[2] http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/
[3] https://fr.mathworks.com/matlabcentral/newsreader/view_thread/344106

Pantxo Diribarne <pantxo>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by pantxo (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.4