MATLAB Answers

how to save figures without margin?

28 views (last 30 days)
Jack Xiao
Jack Xiao on 11 May 2019
Answered: Valeriy on 23 Feb 2020
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?

  0 Comments

Sign in to comment.

Answers (1)

Valeriy
Valeriy on 23 Feb 2020
Try:
axis off; % If you have axis titles, labels, etc.
set (gca,'Position',[0 0 1 1]);
print(gcf,'Test.jpg', '-djpeg', '-r300');

  0 Comments

Sign in to comment.