how to save figures without margin?

32 ビュー (過去 30 日間)
Jack Xiao
Jack Xiao 2019 年 5 月 11 日
コメント済み: Nick Tsui 2022 年 11 月 17 日
as the title, I need to save the figures or images shown in the figure with the same size of the image.
but there are always margins as shown in the following: (the size is 604x593)
捕获asda.PNG
the orginal image is : (the size is 500x430)
ILSVRC2012_val_00000224.JPEG
how to save figures without margin?

採用された回答

Valeriy
Valeriy 2020 年 2 月 23 日
Try:
axis off; % If you have axis titles, labels, etc.
set (gca,'Position',[0 0 1 1]);
print(gcf,'Test.jpg', '-djpeg', '-r300');
  2 件のコメント
Maximiliano Barbosa
Maximiliano Barbosa 2022 年 2 月 18 日
Thank you
Nick Tsui
Nick Tsui 2022 年 11 月 17 日
There are still some margins on both left and right sides of the image.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by