Take the 2-minute tour ×
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.

I'm trying to decorate a snake path, but I don't get any output using a postaction. Here's the example code.

\begin{tikzpicture}
  \draw [snake=expanding waves, segment amplitude = 1.5cm, segment length = 0.3 cm, postaction={decorate, decoration={random steps,segment length=3pt,amplitude=5pt}}] (0,0) -- (-2,0);
\end{tikzpicture}

Any help would be greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

The postaction is newer drawn. You need to add a draw option to it. On the other hand, I guess that you don't want to draw the main path. In that case, you should change \draw to \path.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,snakes}
\begin{document}
\begin{tikzpicture}
    \path [
           snake=expanding waves, segment amplitude = 1.5cm, segment length = 0.3 cm, 
           postaction={draw,decorate, decoration={random steps,segment length=3pt,amplitude=5pt}}
          ]
          (0,0) -- (-2,0);
\end{tikzpicture}

\end{document}

result

share|improve this answer
    
Thanks, that worked. As a note, I had to change the \draw to a \path in order to achieve the effect I wanted (only the randomized postaction path). –  Derek Mar 15 '11 at 23:54
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.