Figure origin incorrectly set

조회 수: 3 (최근 30일)
Steve
Steve 2013년 8월 19일
I understand there are some bugs in Matlab 2010 with respect to MonitorPositions. This may be related. I am using multiple displays with Mac OS 10.6.8 and Matlab 7.10.0.
get(0,'monitorpositions')
ans=
1 0 1080 1898
5561 818 1920 1080
7481 818 1920 1080
3641 698 1920 1200
1081 458 2560 1440
The first monitor [1 0 1080 1898] is set as the system default monitor. Attempting to position on the system default monitor fails:
set(gcf,'position',[1 0 5000 1000])
get(gcf,'position')
ans=
1081 1 5000 1000
The figure is always positioned at the start of the "second" monitor ([1081 458 2560 1440]). Perhaps this is related to the jumbled order of screens in the monitorpositions output?
Additionally, I honestly don't understand the Macintosh description for monitorpositions here. http://www.mathworks.com/help/matlab/ref/rootobject_props.html
MATLAB on Macintosh systems recognize only the main monitor. The position data is of the form [x,y,width,height-menuHieght]... The main monitor is determined by which display has the menu bar.
If Matlab only recognizes the main monitor, why do I get expected output with monitorpositions, and if the main monitor defines the origin, why is the origin not set by the main monitor?
I should note that if I attempt to set the gcf positions again, it works as expected, but if and only if I type the command manually. It will not work when being called with a .m file.

답변 (1개)

Daniel Shub
Daniel Shub 2013년 8월 19일
A few years ago TMW did not officially support multiple monitors. I have never read anything to suggest that anything has changed. http://www.mathworks.co.uk/matlabcentral/answers/3910#comment_7916
  댓글 수: 1
Steve
Steve 2013년 8월 19일
Interesting. So, it's included but not officially supported. I might experiment with reordering the plugs into the video cards to see if that affects the order of the monitors returned by MonitorPositions. If so, I might be able to kludge something that way.
Thanks for the thoughts.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by