Exporting figures from MATLAB to LaTeX is best done via .eps or directly to PDF. MATLAB's saveas()
functionality supports both. The benefit of these file-types is that thy are vector files, meaning, loosely, that coordinates of corners in the lines are saved, as opposed to a bunch of fixed pixels such as with PNG or JPG figures. Using then these figures in LaTeX gives infinite scalability (theoretically, usefulness of highly-zoomed figures may vary).
If you need different aspect ratios, i.e. one figure taller than broad, the other broader than tall, You'd have to set the proper aspect ratio for each figure independently, then save using one of the aforementioned vector file types.
One of the best ways to export pretty figures is the export_fig()
functionality written by Oliver Woodford and currently maintained by Yair Altman and freely available on the FileExchange.
Answering your first question: yes you can resize figures after generating them. Either by hand (change the window size), or programatically: you can make a figure handle (h=figure();
, where h
is your handle), which has several options to control figure size; h.position
being the most prominent: [upper-left, lower-left, upper-right, lower-right]
being its content in terms of corner coordinates. Changing those changes the figure size.