Saving a figure in full screen size?

75 ビュー (過去 30 日間)
Giuseppe Papari
Giuseppe Papari 2017 年 5 月 16 日
コメント済み: Surama Biswas 2021 年 3 月 10 日
Hello,
I am trying to save a matlab figure in PNG format, I wish to have a full screen size image. I have tried the following two scripts, in both cases the figure is visualized in full screen size, but the PNG file I get is smaller. Could anyone help me to fix this issue?
I thank you in advance. Giuseppe
figure('units','normalized','outerposition',[0 0 1 1])
plot([0,1], [0,1])
print('foos', '-dpng', '-r0');
or
figure; set(gcf, 'Position', get(0, 'Screensize'));
plot([0,1], [0,1])
print('foos', '-dpng', '-r0');

採用された回答

Jan
Jan 2017 年 5 月 16 日
FigH = figure('Position', get(0, 'Screensize'));
F = getframe(FigH);
imwrite(F.cdata, 'Foos.png', 'png')
  4 件のコメント
Mustafa Vardaroglu
Mustafa Vardaroglu 2019 年 12 月 10 日
Thanks a lot!
Surama Biswas
Surama Biswas 2021 年 3 月 10 日
How about if i want to save the image after imwrite?

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

その他の回答 (1 件)

Sarwan ali
Sarwan ali 2019 年 1 月 24 日
To extend the answer from Jan, you can also use "saveas" command instead of imwrite
FigH = figure('Position', get(0, 'Screensize'));
saveas(FigH, 'Foos.png','png');

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by