I am trying to plot a small dataset and a regression line for it.
Here is my MWE:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents}{dtat.dat}
X Y
1 9
2 8
3 4
4 2
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table [x=X,y=Y] {dtat.dat};
\addplot table [x=X,y={create col/linear regression={y=Y}}] {dtat.dat};
\end{axis}
\end{tikzpicture}
\end{document}
Though I believe my file accurately reflects the examples in the manual and online, I get the following error:
Package pgfplots Error: Sorry, could not retrieve column 'create col/linear r egression={y=Y}' from table 'dtat.dat'. Please check spelling (or introduce nam e aliases)..
The data plots accurately, but the regression line basically plots the x values (or line numbers?) against themselves and is clearly incorrect. Any help resolving this (probably simple user) error would be greatly appreciated.
In case it makes a difference, I am using TeX Live on Ubuntu and Linux Mint, which are both fully up to date). The version of pgfplots.sty is 1.2.2 from 2009/02/14. (Woefully outdated I'm guessing...?)
pgfplotsyou have: could you add\listfilesto your input, then in the log find the 'File List' and edit that into the question? – Joseph Wright♦ Sep 8 '12 at 14:36