Created
June 27, 2018 12:48
-
-
Save megrxu/6e2008f94050902e4d6747f91ef4a80a to your computer and use it in GitHub Desktop.
Exporting a figure in Matlab to PDF often outputs a A4-sized pdf file. This snippet can export an standalone pdf which can be used in TeX file directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Exporting a figure in Matlab to PDF often outputs an A4-sized pdf file. This snippet can export a minimal size pdf which can be used in TeX files directly. | |
% some figures here | |
figure; | |
plot(zeros([1, 5])); | |
% codes that works | |
fig = gcf; | |
fig.PaperPositionMode = 'auto'; | |
fig_pos = fig.PaperPosition; | |
fig.PaperSize = [fig_pos(3) fig_pos(4)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!!!