When using pgfplots
, is there a way to plot only the first n
rows of a given table ?
Considering the following MWE file:
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=16cm,height=8cm,
view={-45}{65},
scale only axis,
xmin=200,xmax=500,
xlabel={data1},
ymin=0,ymax=100,
ylabel={data2},
zmin=0,zmax=1,
zlabel={data3},
]
\addplot3 [
thick,smooth,
color= darkgray,
solid]
table[row sep=crcr] {
250 0 0\\
250 25 0.2\\
250 50 0.3\\
250 75 0.2\\
250 100 0\\
};
\addplot3 [
thick,smooth,
color= darkgray,
solid]
table[row sep=crcr] {
450 0 0.5\\
450 25 0.1\\
450 50 0\\
450 75 0.1\\
450 100 0.5\\
};
\end{axis}
\end{tikzpicture}%
\end{document}
How can I plot only the first n=4
rows of each table and ask pgfplots
to stop reading the table once this row is reached ?
Of course, for the above example, this seems useless, but when huge data tables are used, this could be extremely usefull, in particular to use the same data and focus on different parts of the table in different figures.
n
rows of a table).