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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by