How do we change the size of a figure (graph) to be larger than the default?

조회 수: 14 (최근 30일)
Hi, the size of my screen is 1366x768 (width x height). How can I force the graph below (via command line) to use the entire screen instead of a small figure?
w = 0:pi/100:2*pi;
y1 = sin(w)';
h=plot(w,y1);
I thank you in advance for your help
Emerson

채택된 답변

José-Luis
José-Luis 2012년 10월 3일
scrsz = get(0,'ScreenSize');
figure('Position',scrsz);
plot(rand(10,1));
  댓글 수: 5
Emerson De Souza
Emerson De Souza 2012년 10월 3일
It means, if you run the code above, you will obtain two figures: the first with the curves and a second with the correct size but empty. I wished to have the empty figure with the curves in it.
Thank you
Emerson

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

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 3일
편집: Azzi Abdelmalek 2012년 10월 3일
set(gcf, 'PaperUnits', 'centimeters','PaperPosition', [0 0 15 15])
% you can change paperunits to 'inches' or 'points',...
  댓글 수: 2
Emerson De Souza
Emerson De Souza 2012년 10월 3일
Hi Azzi, I tried your suggestion and varied the values (0 0 15 15) but it does nothing to the figure (image or graph). Did you tried and worked?
Thank you for your help
Emerson
Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 3일
편집: Azzi Abdelmalek 2012년 10월 3일
Ok, because it changed it when you save it to an image file (jpg,...)
José Luis's code is fine

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by