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

72 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Jana Katharina Wrosch
Jana Katharina Wrosch il 8 Nov 2017
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 Commenti
Jeff Severino
Jeff Severino il 14 Feb 2020
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 il 23 Feb 2023
Modificato: Brian Derstine il 23 Feb 2023
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.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by