I am trying to make a plot of some data points which I have applied linear regression to in pgfplots. However, I am not interested in using all data points for the regression. How do I ignore the first, say 3 rows?
I have tried with the setting skip first n=2, but it does not seem to have any effect, as it runs the regression on all points.
\documentclass[11pt,a4paper]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\begin{document}
\pgfplotstableread[col sep=comma]{%
a,b
1,-12.5894348439729
2,-12.7542953929274
3,-12.8646539338807
4,-13.2133933292766
5,-13.7892202984399
6,-14.5668071605761
}\test
\begin{tikzpicture}
\begin{axis}[%
width=\textwidth,
axis x line=bottom,
axis y line=left]
\addplot[only marks, blue] table[x={a}, y={b}]{\test};
\addplot[mark=none, blue] table[skip first n=2, x={a}, y={create col/linear regression={y=b}}]{\test};
\end{axis}
\end{tikzpicture}
\end{document}

skip lines nis for skipping file headers not data filtering. – percusse May 01 '18 at 10:42\jobname.datfile – percusse May 01 '18 at 10:49