I want to add a non-numerical value as a node on a histogram. The labels come from a column in a table, fairly similar to this other question, i.e. using value \thisrow{<column>} as <macro>. The problem I'm finding is that the labels are note properly rendered, instead they show up as thisrow("<column>")
This is my code
\documentclass[border = 5pt]{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat = 1.15}
\begin{filecontents*}{my.csv}
key,value,label
k1,1,foo
k2,2,bar
k3,3,baz
k4,4,qux
\end{filecontents*}
\begin{document}
\pgfplotstableread[col sep = comma]{my.csv}{\mytable};
\begin{tikzpicture}
\begin{axis}[
xtick = {0,...,3},
xticklabel = {
\pgfmathparse{int(round(\tick))}
\pgfplotstablegetelem{\pgfmathresult}{key}\of\mytable\pgfplotsretval
},
]
\addplot[
ybar,
nodes near coords = {\thelabel{}},
visualization depends on = {value \thisrow{label} \as \thelabel},
] table [
x expr = \coordindex,
y = value
]\mytable;
\end{axis}
\end{tikzpicture}
\end{document}
Thanks in advance



old codeso that the change is clearer (if that's ok). – Dr. Manuel Kuehner May 25 '19 at 14:50\mylabeland\thelabel? – Dr. Manuel Kuehner May 25 '19 at 14:52\mytable, i.e. the macro that contained the table, got replaced by{my.csv}, i.e. the file that contained the table. May I ask you to revert the changes? (+1 to you, too.) – May 25 '19 at 14:53visualization depends onandnodes near coords? I am too blind to see it :). – Dr. Manuel Kuehner May 25 '19 at 15:06