필터 지우기
필터 지우기

How and why Matlab defines maximal values for gcf's position (width and height)? It looks like these values are screen resolution dependent ...

조회 수: 9 (최근 30일)
If I run subroutine which outputs a figure on 12,5" laptop (screen resolution 1366x768) with the following gcf settings:
set(gcf, 'Units','pixels ','Position',[0 0 1500 1500]);
then Matlab automatically cuts the figure position (width and height) to [0 0 1366 698].
This causes problems already on the screen and then also when gcf is exported to file (saveas(gcf,filename,'pdf');). As the subroutine is being used on different computers, the generated output figure is not identical. In case of 12,5" laptop, the figure is not recognizable ...
What shall I do to avoid this problem?
Thanks, Janez
  댓글 수: 2
Albert Yam
Albert Yam 2012년 7월 25일
Does it have to do with the figure that is being opened/created? If I run
figure;plot(1:10)
set(gcf, 'Units','pixels','Position',[0 0 3000 3000]);
The figure window is bigger than my screen, but it doesn't get chopped off. (I have to right click the start bar > move to get it to show.)
Janez
Janez 2012년 8월 2일
I tried on different platforms (XP, Win7), different screen resolutions and different Matlab releases. The GCF is always chopped off.

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

답변 (3개)

Daniel Shub
Daniel Shub 2012년 7월 25일
Instead of using units of pixels, use normalized units. This way you do not have to worry about making figures larger than the screen size.
  댓글 수: 2
Janez
Janez 2012년 8월 2일
Good idea, but doesn't solve my problem.
First: My GCF contains several TEXT definitions. The problem is that the text appearing on GCF has fixed size and the text is overlapping when low resolution is applied.
Second: The output to file (in my case the output is A4 pdf file) is still not independend of screen resolution. Every user gets different output.
Daniel Shub
Daniel Shub 2012년 8월 3일
Why don't you edit your question to include some example code that demonstrates the problem and lists all of the requirements.

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


Leah
Leah 2012년 7월 25일
figure;plot(1:10)
set(gcf, 'Units','normalized','Position',[0 0 1 1]); %fullscreen
position is a percentage of your screen, instead of pixels
  댓글 수: 1
Image Analyst
Image Analyst 2012년 8월 3일
I think he knows that. His problem is that when he goes to save an file, it saves it as the current max screen resolution, and then when that image is recalled, it looks weird on other computers with different resolution than his.

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


Image Analyst
Image Analyst 2012년 8월 3일
It lets you specify an exact resolution for your output image. I haven't tried to do this, but see what happens if you specify a resolution larger than your screen. See if it gets saved out with that larger resolution, or if it limits it to your screen's resolution. Let us know how it works.

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by