Skip to content

Instantly share code, notes, and snippets.

@Peng-YM
Created March 26, 2019 14:54
Show Gist options
  • Select an option

  • Save Peng-YM/05426f2af857197844778eae76e4a609 to your computer and use it in GitHub Desktop.

Select an option

Save Peng-YM/05426f2af857197844778eae76e4a609 to your computer and use it in GitHub Desktop.
Export Matlab figure to PDF without margin
h = figure;
plot(1:10);
set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
print(h,'filename','-dpdf','-r0')
@a123455392
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment