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

13 ビュー (過去 30 日間)
Emerson De Souza
Emerson De Souza 2012 年 10 月 3 日
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
José-Luis
José-Luis 2012 年 10 月 3 日
See my previous comment.

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by