13

I find:

\begin{tikzpicture} \draw [->,decorate,decoration=snake] (0,0) -- (2,0); \end{tikzpicture} 

in TikZ manual, but dose not work! How can i draw snake edges in automata using tikz?

4
  • 1
    Did you load the appropriate \tikzlibrary? Commented Aug 26, 2012 at 18:59
  • Can you please add your full document starting from \documentclass{..... \emd{document} into your question? Commented Aug 26, 2012 at 19:03
  • @percusse Well for some reason or the other, it does not compile on my computer if I do not load \usetikzlibrary{decorations.pathmorphing}. Commented Aug 26, 2012 at 19:08
  • @azetina You are right I was loading pgfplots and somehow it goes through. Commented Aug 26, 2012 at 19:17

1 Answer 1

25

The following code compiles:

\documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} %\usepackage{pgfplots} %% Using pgfplots package alone works as well. \begin{document} \begin{tikzpicture} \draw [->,decorate,decoration=snake] (0,0) -- (2,0); \end{tikzpicture} \end{document} 

This yields the output in the manual.

enter image description here

But as the manual suggests,

\begin{tikzpicture} \draw [->,decorate,decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] (0,0) -- (3,0); \end{tikzpicture} 

yields a better output as follows:

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.