Lab Guidelines for Graphics in Publications

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.

Table of Contents

This document describes how graphics should be created and included in all writings of the lab, especially in but not limited to LaTeX.

General requirements

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:

  • For photos: the raw images before editing.
  • For diagrams: the source files in the original programs or languages used to create the diagrams. For instance, the source files for DIA, IPE, Adobe Illustrator, and the source code files if TikZ or Asymptote is used.
  • For graphs / plots: the source code and data to generate the plots, for instance in Matlab, Python, Julia, Gnuplot, etc.

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.

Graphic types / formats

Generally there are two types of graphics:

  • Bitmap / Raster: these are pixel-based graphics, for example photos. These images usually lose / change quality when they are transformed (e.g., resized, rotated, stretched). Typical formats: BMP, JPEG, PNG, TIFF, GIF. Bitmap files are often large if high graphic quality is desired.
  • Vector: graphics are essentially created by drawing commands in some sort of programming languages (like: draw a line from one point to another using certain color, line style, line width, etc.). These graphics usually maintain the highest quality under transformations, e.g., they can be resized or rotated in any way and still have the sharpest and best quality. This is because the graphics are constructed by programs. It is easy to edit the graphics by changing the drawing commands. Typical formats: EPS, PDF, SVG. Note that vector graphic formats usually allow embedding bitmap images inside the vector graphics, for example in PDF files.

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.

Creating vector graphics

From Matlab

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.

From other programming languages

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.

Plots

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/

Vector graphic tools

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.

  • Many diagram editors or languages support exporting diagrams to vector graphics and LaTeX code. For example: lucidchart, draw.io, Inkscape, Dia, yEd, GraphViz, Asymptote, Gnuplot.
  • A good general GUI-based vector graphic editor is IPE. It takes time to learn to use IPE, but it’s powerful and it’s open-source.
  • Other software for vector graphics (exportable to LaTeX compatible formats):
    • Inkscape: very good vector graphic editor, geared more towards arts and artists than scientific graphics.
    • LaTeXDraw: a good vector graphic editor for LaTeX using PSTricks (not PGF/Tikz). Not updated regularly but seems okay to use.
    • Xfig: ancient graphic editor, old, but okay to use and have a very broad export capability (to many formats).
  • Suggested tools: choose and master a few tools to use regularly, preferably free / open-source.
    • draw.io for diagrams (block diagrams, UML charts, circuits, mechanical diagrams, etc.) without or very little LaTeX. However, if LaTeX is needed, draw.io may not be good because it tends to embed images of equations instead of actual characters, therefore its PDF export doesn’t look good (its PNG, JPG,… export is good). In this case, for PDF or EPS export, use IPE or other software.
    • IPE for general vector drawing (non-diagrams) like illustrations in papers. It has good LaTeX support but it can’t export to LaTeX code.
    • Inkscape if complex graphics is needed, beyond the capability of IPE/draw.io/other tools.
    • Tikz / Pgfplots for plotting data and functions (either directly or exported from plotting libraries)
    • For certain specialized graphics, like flow charts or network graphs, better use specialized tools / languages (like yEd, GraphViz).
    • LaTeXDraw or Xfig for vector drawing if LaTeX code export is absolutely needed (rare).
    • Tikz / Pgfplots for some structured drawing like control block diagrams if there exist templates and easy-to-modify code (mostly for lecture slides).

Short video overview