I have loads of pgfplots which have one thing in common, they all containt one or two addplot with four points that I want to label with the same labels, namely: \tau_c= n \theta. Lets for simplicity say n is 1, 2,3 and 4. Using foreach loop variable as node label in pgfplots looks very much like something that could solve my problem. But how do I append this (or similar) solution when the coordinates are given as in the MWE below? My pgfplots are generated with matlab2tikz and are as mentioned quite numerous, so I would like to avoid having to manipulate the existing file too much.
An MWE
\documentclass{memoir}
\usepackage{tikz, pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
% [spy using outlines={rectangle,black,magnification=3,connect spies}]
\begin{axis}[%
width=3in,
height=1in,
unbounded coords=jump,
scale only axis,
xmin=1.25,
xmax=3,
xlabel={That},
ymin=0,
ymax=8,
ylabel={This},
title={Case 11},
% legend style={draw=black,fill=white,legend cell align=left}
]
\addplot [
color=red,
only marks,
mark=o,
mark options={solid},
forget plot
]
table[row sep=crcr]{
2.17534491233797 1.76417509678952\\
1.70352168717505 2.47466020520172\\
1.50385056450878 3.36056987643388\\
1.39330071637349 4.41283273476325\\
};
\end{axis}
\end{tikzpicture}%
\end{document}


nodes near coordsappend to only one or two of manyaddplots in the sameaxisenvironment? Somehow label theaddplot, maybe? – Holene Jun 01 '13 at 22:12nodes near coords={...}in the\addplot[...]options for the relevant plot. – Jake Jun 01 '13 at 22:13nto be a macro? For instance\sfrac{1}{2}... – Holene Jun 01 '13 at 22:17\sfracdepend on the coordinate index in some way? Or would you rather hard code them by providing a list of labels? – Jake Jun 01 '13 at 22:18$\sfrac{1}{2}\theta$,$\theta$,$\sfrac{3}{2}\theta$,$2\theta$... – Holene Jun 01 '13 at 22:20