I am unable to take data from a .csv
file and generate a simple scatter plot. The file contents are:
Group x y
Group1 10 1.1
Group2 20 8.1
Group3 9 0
Group1 11 2
Group2 20 8.2
Group3 8 0.2
Group1 11 2
Group2 20 9.1
Group3 9 0.1
The code is:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{statistics}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=major,
grid style={dotted},
table/col sep=comma,
scatter/classes={%
Group1={brown, mark=*, mark size=1.5pt},
Group2={black, mark=x, mark size=2.5pt},
Group3={red, mark=square*, mark size=1pt}},
scatter, only marks,
scatter src=explicit symbolic
]
\addplot+ [] table[header=true, only marks, x=x, y=y, meta=Group] {Test.csv};%
\end{axis}
\end{tikzpicture}
\end{document}
I keep getting the error:
Sorry, could not retrieve column 'x' from table '\\pgfplotstableread@filename@@table@name '. Please check spelling (or introduce name aliases)..
csv
= comma separated values