Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to reduce my redundancy when making plots with pgfplots. I want to have a single PDF file, such that I can include them on a per-page basis with graphicx.

The multi class option for the standalone class (the class I'm writing my plots with) looks promising, but instead of treating the plot as a single block, multi treats the plot as a single page. (which I assume is multi's purpose).

As an example, I'd like to achieve a result similar to this PDF file, but with pgfplots (from "A Course on Deterministic Distributed Algorithms" by Jukka Suomela).

MWE Code:

% Remove the `multi` option and the code in between the
% comment bars to achieve the `standalone` default output.
\documentclass[multi]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

MWE Output:

mwe output

share|improve this question

1 Answer 1

up vote 4 down vote accepted

If you use

\documentclass[tikz]{standalone}

rather than multi then you get one plot per page.

You might also be interested in

\usetikzlibrary{external}
\tikzexternalize[mode=list and make]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.