# Notes for producing clean plots in Matlab for LaTeX

Remarkably, MATLAB does not have in-built support for exporting figures as EPS files with placeholders plus a TEX file (hence allowing LaTeX to do the typesetting). But there are some user-submitted scripts. The most promising looks to be matlabfrag.

After producing a figure in MATLAB, output an `.eps`

file like
this:

And then in the LaTeX document use `\psfragfig{filename}`

(no suffix; just the base of the filename) to
insert the figure. You’ll also need to add `\usepackage{graphicx}`

and `\usepackage{pstool}`

to the LaTeX file’s preamble.