I have two data files, one with measurement values (data.dat) and a second one with model data that describes how the values in data.dat are expected to behave (model.dat). Values in data.dat are added every now and then as they occur.
The values in model.dat span over a far greater x range than the measurement values in data.dat. Currently I limit the x axis to fit the data.dat values "manually" by setting an appropriate xmax value. However, it would be nice if the x axis range would be calculated automatically according to the data.dat values either by
- ignoring the model.dat values for the axis range calculation or
- telling pgfplots to calculate the axis range based on a certain plot or data file.
Is there such functionality in pgfplots?
Comment: Define different ranges for different data sets when plotting from a file or table might be loosely related or could be the way towards a workaround.
\begin{filecontents}{model.dat}
x y
0 1
1 0.8
2 0.75
3 0.72
4 0.7
5 0.69
\end{filecontents}
\begin{filecontents}{data.dat}
x y
0 0.99
1 0.81
2 0.74
3 0.70
\end{filecontents}
\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmax=4]
\addplot table[x=x,y=y] {data.dat};
\addplot table[x=x,y=y] {model.dat};
\end{axis}
\end{tikzpicture}
\end{document}

