figure pop outside the screen
106 次查看(过去 30 天)
显示 更早的评论
Hi. I have trouble with a default figure position.
Somehow my figure always comes outside the window. If I reset the default figure position like below, the figure still appears outside the valid screen.
set(0, 'DefaultFigurePosition', [0 0 400 300]);
figure()
Does anybody know the good way to fix this problem?
和文
matlabの図が画面外に出る現象に困っています。 DefaultFigurePositionを設定しても,画面外右に出てくるのでMATLABのディスプレイ認識が間違っているのではと思っていますがPCごと再起動しても改善されません。 どうすればよいでしょうか。
3 个评论
michio
2018-2-4
This might be related to your issue. Are you using MATLAB via remote access or do you have multiple screens?
What does the following reply?
get(0,'ScreenSize')
采纳的回答
michio
2018-2-6
Thanks! I forgot to ask. What version of MATLAB are you using and on what OS?
Also please note that MATLAB sets the display size values for this property at startup. The values are static and your system display settings change do not reflect on those values. MATLAB needs to restart to refresh the value.
See: https://jp.mathworks.com/help/matlab/ref/root-properties.html describes the properties related to the graphics.
One thing caught my attention is your numbers do not seem to be in pixel. As stated in the "Units" property of the following page, 'ScreenSize' and 'MonitorPosition' will in pixel by default setting. Could you try the following to double check?
get(0, 'Units');
get(0, 'MonitorPositions');
I am guessing if your 'Unit' is not in pixels (and if you did't change it), it could indicate that there are some scripts that do changes the graphics properties at start-up. Any ideas?
startup.m is one possibility.
Could you check if you have startup.m by executing
which -all startup
Another thing you can try is to refresh your prefdir folder, which contains preferences, history, and layout file. You can delete the folder and restart MATLAB.
View the location of the preferences folder by
prefdir
3 个评论
michio
2018-2-7
Just to clarify, what happens if you comment out all the command on your startup.m and restart MATLAB?
Just wanted to double check the values of defaultfigurepositon without startup.
michio
2018-2-7
Also on prefdir, you can make a backup copy of the original folder and put them back later with the same name. Then any setting you currently have will be restored.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 グラフィックス オブジェクトのプロパティ 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!