how to save figures without margin?

38 vues (au cours des 30 derniers jours)
Jack Xiao
Jack Xiao le 11 Mai 2019
Commenté : Nick Tsui le 17 Nov 2022
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?

Réponse acceptée

Valeriy
Valeriy le 23 Fév 2020
Try:
axis off; % If you have axis titles, labels, etc.
set (gca,'Position',[0 0 1 1]);
print(gcf,'Test.jpg', '-djpeg', '-r300');
  2 commentaires
Maximiliano Barbosa
Maximiliano Barbosa le 18 Fév 2022
Thank you
Nick Tsui
Nick Tsui le 17 Nov 2022
There are still some margins on both left and right sides of the image.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by