Why is the difference between the figure's Position and OuterPosition not integer?

11 ビュー (過去 30 日間)
Jan
Jan 2015 年 12 月 18 日
編集済み: Jan 2015 年 12 月 24 日
I'd expect that the Position and the OuterPosition of a figure in pixels units differs by an integer number. But on my Windows7/64, Matlab 2015b system I get:
FigH = figure('Units', 'pixels')
get(FigH, 'Position')
% 289 388 560 420
get(FigH, 'OuterPosition')
% 284.56 383.22 568.89 505.78
Or:
set(FigH, 'OuterPosition', [100, 100, 400, 300]);
get(FigH, 'Position')
% 104.11 104.11 391.11 215.11

採用された回答

Jan
Jan 2015 年 12 月 18 日
編集済み: Jan 2015 年 12 月 18 日
This happens under Window (at least Windows 7), when you set the text size to a custome value:
Control Panels -> Display -> Set custom text size (DPI)
Choose e.g. 113%
Then the size of the window border is scaled also and does not have an integer pixel size.
A solution is almost trivial, after it is found.

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 12 月 18 日
I would never expect the difference to differ by an integer number of pixels. DefaultAxesUnits is normalized and while DefaultAxesOuterPosition is [0 0 1 1], DefaultAxesPosition is [.13 0.11 0.775 0.815]
Any default that is in normalized units is unlikely to come out as integral number of pixels.
  1 件のコメント
Jan
Jan 2015 年 12 月 24 日
編集済み: Jan 2015 年 12 月 24 日
@Walter: Did you see that the units have been set to pixels and that my question considers figures, not axes? The default figure units are pixels and the window borders are set in pixels values in the operating system also.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by