I have a datafile containing thousands of points of which I need to plot only the first 100 points. How to do this using pgfplots? I tried the following with no effect.
\begin{axis}[
xlabel=k,
ylabel=$R_k$,
xmin=1,
samples y = 100]
\addplot table [x expr=\coordindex+1,y index=0]{datafile.txt};
I also tried,
\begin{axis}[
xlabel=k,
ylabel=$R_k$,
xmin=1
]
\addplot table [x expr=\coordindex+1,y index=0,samples y = 100] datafile.txt};
Any suggestions?