# Automatically get (ymin,ymax) and (xmin,xmax) in pgfplots

I am plotting some 2D data from a file using pgfplots. Is it possible to automatically get (ymin,ymax) and (xmin,xmax) from the file I am trying to plot? I don't want to keep changing these each time I plot a different file.

Not setting these ranges will leave some undesired white spaces in my plots.

• See Christians answer about calculations on data columns using the features of pgfplots. Feb 14 '14 at 15:47

To prevent PGFPlots from adding padding around your data, set enlargelimits=false:

\documentclass[]{article}

\usepackage{pgfplots}

\begin{document}
Default settings:

\begin{tikzpicture}
\begin{axis}
3 2
5 3
9 11
};
\end{axis}
\end{tikzpicture}

\hspace{2cm}

With \verb|enlargelimits=false|:

\begin{tikzpicture}
\begin{axis}[enlargelimits=false]