Last update: 2026-01-22
Download a summary slide deck, auto-generated by NotebookLM.
A short video overview, auto-generated by NotebookLM is available at the bottom of this page.
This document describes how graphics should be created and included in all writings of the lab, especially in but not limited to LaTeX.
All graphics created for our writings must be of publication quality. This means that the graphics are not only correct, scientific, illustrative, beautiful, but also in the right formats for quality publication.
In all cases, the source of each graphical illustration must be kept, for example:
We also prefer programming-based or open-source / free options (such as TikZ, Asymptote, IPE, draw.io, Python, Julia, Gnuplot, etc.) instead of proprietary options (such as Matlab, Adobe). Do not use Powerpoint to create graphics for publications, except for slides.
Generally there are two types of graphics:
A key to high-quality graphics is to use the right graphic formats. A common mistake, even by experienced researchers, is to use bitmap formats (JPEG, PNG, TIFF) for vector graphics, resulting in either low graphic quality or large file size, or both. Because this issue almost always happens with bitmap formats being used for vector graphics, and because creating vector graphics is more involved than creating bitmap graphics, we will only discuss rules for vector graphics.
Matlab figures should be converted to vector graphics for inclusion in publications.
Easy way: A quick way to do this is to use the print function. Use -depsc to save the figure as an EPS file, then you can convert the EPS file to a PDF file. To convert from EPS to PDF, you can use epspdf or epstopdf which are often included in LaTeX distributions. For example, to save a current figure in Matlab to a file named fig.eps, run this command in Matlab:
print fig.eps -depsc
The option -depsc will produce a color figure, while -deps will produce a black-and-white figure. To convert the generated EPS file into PDF using the command-line programs above, in a terminal, run epspdf fig.eps or epstopdf fig.eps (in Windows, open the command line cmd.exe window or a Shell window, and the programs should have exe extension).
Best way: For plots, especially plots of data, the best graphic quality in LaTeX is achieved by converting a Matlab figure into TikZ/Pgfplots code. Tikz/Pgfplots is a LaTeX package for drawing and plotting, which is both beautiful and high-quality. For more information, see its webpage or examples. A Matlab toolbox called matlab2tikz can automatically convert Matlab figures into Tikz code files, which can be included directly into LaTeX files to produce beautiful and high-quality plots. I usually use this method to include plots from Matlab in papers written in LaTeX.
Many plotting libraries in Python, Julia, etc., can save plots directly to EPS / PDF files as vector graphics, often by using an appropriate backend. Use this capability when using these libraries. Furthermore, many allow saving plots into LaTeX-compatible files, including TikZ/Pgfplots. Use this option whenever possible.
Note: it is acceptable to create plots in bitmap/raster formats for the purpose of viewing when developing code; however, the final graphics for inclusion in publications must be in vector formats.
For plots, always use vector graphics. They can be exported from the plotting libraries as mentioned above. GNUPlot can also be used for plotting and exporting plots to LaTeX compatible formats. You can also write TikZ / Pgfplots code directly to plot functions and data. This is actually easy and very powerful but requires you to learn how to use TikZ / Pgfplots. You can save your data into a CSV file and then write Pgfplots code to read and plot the data all within LaTeX. For some examples, see: http://www.texample.net/tikz/examples/tag/plots/
For general vector graphics, especially diagrams and illustrations, one has several ways to create them. We would prefer open-source / free tools and programming-based methods.