I have a comma-separated list of data points. They should be plotted as a scatter plot, and should be labeled using data from the .csv file. Having specified the first column of my file as string type, I still keep running into errors saying Could not parse input [...] as a floating point number, sorry.
Given a CSV file of the following format, how can I read Name and Z as labels?
Name,X,Y,Z
ODIN,250,45,2001
Here is my MWE:
\documentclass{article}
\usepackage{tikz,pgfplots,pgfplotstable}
\pgfplotsset{compat=1.5.1}
\begin{document}
\pgfplotstabletypeset[columns/Name/.style={string type}]{table.csv};
\begin{tikzpicture}
\begin{axis}[
visualization depends on=\thisrow{Name} \as \labela,
visualization depends on=\thisrow{Z} \as \labelb,
every node near coord/.append style={font={\tiny}},
nodes near coords=\labela/\labelb,
nodes near coords align={horizontal},]
\addplot[only marks] table [x=X,y=Y,col sep=comma] {table.csv};
\end{axis}
\end{tikzpicture}
\end{document}
Note that if the data in column Name is just floats it should work fine.
