I am using the decorations.text library to set text along a path drawn by pgfplots. The decoration works fine without marks, as suggested in this answer, but with marks on the path, the compilation fails with Package pgf Error: I cannot decorate an empty path \end{axis}. Why, and is there a workaround?
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+[
no markers,
decoration={
text along path,
text={This is my path},
},
postaction={decorate},
] coordinates {(0,0) (10,1)};
% \addplot+[
% mark=*,
% decoration={
% text along path,
% text={This is my path},
% },
% postaction={decorate},
% ] coordinates {(0,1) (10,0)}; %This one fails
\end{axis}
\end{tikzpicture}
\end{document}

slopedoption to anodeafter theaddplotwould be much simpler, but of course the real use case has a curved plot for whichslopedisn't very helpful. – darthbith Dec 11 '14 at 21:35