How to get default position of figure to be left side monitor

10 ビュー (過去 30 日間)
Joshua
Joshua 2017 年 11 月 8 日
編集済み: Brian Derstine 2023 年 2 月 23 日
I used to have my 'figure monitor' on the right side, but I changed offices and it's not convenient there anymore. So, I went into the startup.m file and changed the line to
set(0, 'defaultFigurePosition', [-1267 44 1256 872])
so that figures would be born in the left monitor. The problem is that the negative is ignored and rounded to one. So, when I generate a figure
f = figure
and query the postion I get
f.Position
ans =
1 44 1256 872
Anyone know how to fix this?

回答 (1 件)

Jana Katharina Wrosch
Jana Katharina Wrosch 2017 年 11 月 8 日
Try normalizing the units first:
f_pie=figure('Units', 'normalized', 'Position', [-1,0,0.8,1]);
This should work also for the default position.
  3 件のコメント
Jeff Severino
Jeff Severino 2020 年 2 月 14 日
this is because the first digit is the position from the left most corner. try changing your default monitor or account for the extra pixels because it technically is two combined screen. Check the resolution
Brian Derstine
Brian Derstine 2023 年 2 月 23 日
編集済み: Brian Derstine 2023 年 2 月 23 日
seems like a bug. The figure position code assumes that the main display will be the leftmost display and all other displays will be to the right. This is not a safe assumption. Plenty of use cases where the main display is the rightmost or center display (or some other arrangement), which breaks when negative values for Position are rounded up to 1.

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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by