# Adding a “passive” plot in pgfplots

I would like to add a plot to a pgfplots figure, but such that it doesn't change the automatically computed limits. for example:

\documentclass{article}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}%[ymin=-6,ymax=6]
\end{axis}
\end{tikzpicture}
\end{document}


As written, the secont plot alters the limits. I could manually specify the limits (by removing the comment), but that's precisely what I want to avoid. Is there an option for this? I've found the forget plot option, but that's not quite what I need.

-
I see a pgfplotsinterruptdatabb environment in the pgfplots documentation, isn't that what you are looking for? –  T. Verron Mar 11 '14 at 13:30

For a single plot, you can use the option update limits=false.

For several plots, you can wrap them in the environment pgfplotsinterruptdatabb.

In both cases, the result is the same: the given plots do not contribute to the computation of the bounding box.

\documentclass{article}
\usepackage{tikz,pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}%[ymin=-6,ymax=6]
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}%[ymin=-6,ymax=6]
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}%[ymin=-6,ymax=6]