You'll often see me use the function fig4pdf in the Matlab scripts for this course. This function makes it easier to save Matlab figures as nicely formatted pdf files that can be included in reports and presentations. It sets the background color and paper dimensions to produce what -- to my eyes -- is a visually pleasing result with properly cropped borders. To use it in your own Matlab programming, just include the function call
fig4pdf;
at some point in the process of preparing a figure. It will have no visual effect on the figure window. Later, when you want to actually save the figure as a pdf file, use the function call
print('-dpdf','r1200', 'myfigure.pdf');
where myfigure.pdf is the desired file name. Alternatively, you can format and save the figure in one step with the function call
fig4pdf(gcf,'myfigure.pdf');
where gcf refers to the current figure. Because I use fig4pdf in so many of demonstration scripts for this course, you may want to download and store this file in your default Matlab folder.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment