Using a simplified version of an older answer as MWE:
\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\foreach \A / \B / \C in {1/100/g, 2/200/h}
\addplot[
mark=diamond*,
visualization depends on={value \C\as\myC},
nodes near coords={\myC}
]
coordinates {(\B, \A)};
\end{axis}
\end{tikzpicture}
\end{document}
This works as intended. But, according to the manual, I should also be able to just specify the macro the save instead of assigning it a new name. So:
\addplot[
mark=diamond*,
visualization depends on={value \C},
nodes near coords={\C}
]
However, this fails with the following error:
Package pgfplots Error: Sorry, `visualization depends on=value <
\macro>' expected a defined control sequence name instead of `\C '. Please make
sure `\C ' is a properly defined macro or use the `visualization depends on=va
lue <content> \as<\macro>' syntax instead.
Why does this version fail? It looks like a space slipped into the macro name. Is this a bug?
