In my quest to solve this question I'm trying to see if I can decorate a mesh-plot by drawing many circles or maybe rectangles with a radius determined by \pgfplotspointmetatransformed. But I can't seem to decorate a mesh-plot. The MWE below contains three tries, all commented out, because all fail with ! Package PGF Error: I cannot decorate an empty path.. I'm using pgfplots 2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f ) and tikz 2010/10/13 v2.10 (rcs-revision 1.76).
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.shapes}
\pgfplotsset{compat=1.5}%
\begin{document}%
\begin{tikzpicture}
\begin{axis}
% all three attemps fail with:
% ! Package PGF Error: I cannot decorate an empty path.
%\addplot[mesh,point meta=y,decorate,decoration={triangles}] {x^2};
%\addplot[mesh,point meta=y,every path/.append style={decorate,decoration={triangles}}] {x^2};
%\addplot[mesh,point meta=y,every path/.append style={postaction={decorate},decoration={triangles}}] {x^2};
\end{axis}
\end{tikzpicture}%
\end{document}
- How do I decorate a mesh-plot?

line cap=roundwith straight line segments. – Jake May 31 '12 at 10:22line cap=rect. You'd need to do something like find half the angle between two consecutive line segments. The problem is related to TikZ: changing colour of a path half way along. – Jake May 31 '12 at 12:24