Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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).

% 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};
  • How do I decorate a mesh-plot?
share|improve this question
I'm not exactly sure how this is going to solve the problem of the joins in your other question: The size of the circles would still change discretely, so wouldn't the result still be the same as when using line cap=round with straight line segments. – Jake May 31 '12 at 10:22
Right, circles would not be the right way to go. But rectangles would? In my understanding, decorations work on a local coordinate system where x is defined along the decorated line and y perpendicular to it, so a rectangle would actually consist of two parallel and two perpendicular line-segments, if I'm not mistaken. – gerrit May 31 '12 at 12:04
Yes, that's right, but then the joins would end up looking like the second example in my answer, with line 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
Mesh plots in pgfplots use the pgf basic layer engine... perhaps this fools the decoration lib (which is based on the tikz frontend if I am not mistaken). – Christian Feuersänger Jun 2 '12 at 19:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.