Skip to content

TikZ export

TikZ / PGFPlots export writes LaTeX source, not a rendered figure: a zip you compile yourself. It works offline. Choose a panel's ⋯ → Export options…, tick TikZ / PGFPlots, and pick a layout:

Layout What you get
As on screen (default) the panel's current layout, at the width and base size of the dialog. The one-click TikZ entry and "Export all panels" use your last choice.
Paper target a layout computed for where the figure goes, from its content

Targets

Target Size
Single column 85 mm wide, at most 230 mm tall
Double column 178 mm wide, at most 230 mm tall
A4 portrait 160 × 247 mm (text area)
A4 landscape 247 × 160 mm
Slide (16:9) 160 × 90 mm
Custom your width and maximum height

A figure with more panels than fit the target's height is made taller, and the file says so.

The same goodness-of-fit panel (synthetic data) at each target:

Single column

Single column

Double column

Double column

A4 portrait

A4 portrait

A4 landscape

A4 landscape

Slide

Slide

What is computed

  • Fonts from a base size of 8–11 pt: title = base + 1, axis labels = base, ticks and legend = base − 1, never below 6 pt.
  • Orientation and the number of grid columns, from the content.
  • Tick labels that do not overlap: fewer numeric ticks; categorical labels rotated, abbreviated or thinned. Abbreviations and thinning are listed in the % caption note: lines of the .tex file. Large or small axes get a common power of ten.
  • Legend inside free space, above, below or beside the axes, in as many columns as fit. Series also differ in dash pattern or mark shape, for greyscale printing.
  • Heatmaps: a colour bar, cell values only when all of them fit, and colour maps whose lightness rises steadily (viridis, cividis, greys, or blue → grey → yellow for signed data). So the diverging colours differ from the red–blue on screen; choose as on screen to keep them.
  • Labels: LaTeX characters in names are escaped; parameters such as c_k and Greek symbols are set as math; minutes use siunitx.

Change the defaults

The dialog shows each computed value as the placeholder of its field. Type a value to override it, and Reset to computed defaults to undo. You can set the target, size, orientation, every font size, legend position and columns, grid columns, tick counts, x label rotation and colour map. The preview is drawn by the browser from the computed layout; it is not a TeX rendering, so fonts and marks differ slightly. With settings that make labels collide, the dialog says which.

Every exported .tex stores the settings in a % pkv-tikz-settings: line. Load settings from an exported .tex restores them, so a figure can be reproduced. Each panel also has its own preset (shape, columns, legend, colour map), applied where you have not chosen yourself.

Put a figure in your paper

Unzip next to your document, for example into figs/nm-gof/. The standalone file <panel>-standalone.tex compiles alone with pdflatex or lualatex. To include the figure directly, copy the lines between \documentclass and \begin{document} of that file that load siunitx and pgfplots, set libraries, math sizes and colours into your preamble (the font lines are optional), then:

\begin{figure}
  \centering
  \renewcommand{\pkvdir}{figs/nm-gof/}% folder holding data/ (omit if it is the current one)
  \input{figs/nm-gof/nm-gof.tex}
  \caption{...}
\end{figure}

Declare \newcommand{\pkvdir}{} once in your preamble so that \renewcommand works. The figure is already at the target's size: do not wrap it in \resizebox, which would change the font sizes. Small tables are written into the .tex; larger ones are read from data/.

Limits

  • So that pdfLaTeX can compile them, layers beyond about 4,700 points become a 600 dpi image inside PGFPlots axes. The file says so; the data files still hold every value.
  • Panels' explanatory legend sentences are written as % caption note: lines: put them in your caption.
  • Colour bars show one range; if panels differ, the caption note says so.