What option do I need to get a wavy arrow between two points:



\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,
  thick,main node/.style={circle,fill=#1!0,draw,font=\sffamily\Large\bfseries}]

\node[main node=black] (1) {a};
\node[main node=black](2)[right of=1]{b};

  \path[every node/.style={font=\sffamily\small}]
    (1) edge[<<<WAVY ARROW OPTION>>>, very thick, color=blue] node [] {} (2)


I assume the fix is an easy option where I've put <<<WAVY ARROW OPTION>>>.

  • Welcome to TeX.SE! See Tikz & PGF manuel, page 581. There is on the top of page example \begin{tikzpicture}[decoration=snake] \draw [help lines] grid (3,2); \draw [decorate,fill=yellow!80!black] (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; \end{tikzpicture}. For it you need to load library decorations.pathmorphing.
    – Zarko
    Jan 8 '17 at 18:48
  • So, I just put that right where (options) is?
    – Domemy
    Jan 8 '17 at 18:52
  • ??? (1) edge[decoration=snake, very thick, color=black]node[]{}(2) ???
    – Domemy
    Jan 8 '17 at 18:56
  • Solution in your comment is not correct. See example in my comment. The best would be, that you read mentioned manual. Given example can serve as starting point. For more help you need provide a minimal working example: complete small document starting with documentclass{...} and end with \end{document}. Than someone her (including me) can help you in solving of your problem.
    – Zarko
    Jan 8 '17 at 19:04
  • @Zarko, I've made an edit to my post.
    – Domemy
    Jan 8 '17 at 19:08

enter image description here

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows, decorations.pathmorphing}

        ->,    > = stealth',
       shorten > = 1pt,auto,
   node distance = 3cm,
      decoration = {snake,   % <-- added
                    pre length=3pt,post length=7pt,% <-- for better looking of arrow,
main node/.style = {circle,draw,fill=#1,
\node[main node=black]  (1)     {a};
\node[main node=black]  (2) [right of=1]{b};

\path[draw=blue, very thick, decorate] (1) -- node[above] {?} (2);
\draw[red] (1) -- node[below] {straight line} (2);

In your MWE I consider only for image necessary packages, i.e. only TikZ libraries. For better looking of arrow I add "complications" which make begin and end of arrow straight.

Edit: decoration is activated only on path with option decorate. Consequently red line (note: \drawis shorthand for\path[draw]), which hasn't optiondecorate`.

  • So does this make all my arrows wavy? Because I only need one.
    – Domemy
    Jan 8 '17 at 19:23
  • no, only this one, which for option has decorate. See edit of my answer (will appear soon).
    – Zarko
    Jan 8 '17 at 19:24
  • Now, how do you choose whether or not the text is on the left or right (above or below) of the arrow?
    – Domemy
    Jan 8 '17 at 20:05
  • you really need to read TikZ manual. In Part I are tutorials, where is explained this :). In your case for text on the left from arrows start: \draw[...] (...) node[left] {text} -- (...);, for node right of the arrow's end:\draw[...] (...) -- (...) node[right] {text} ;, for above right of arrow start: \draw[...] (...) node[above right] {text} -- (...); etc. for above and below of arrow's middle, see MWE in answer. for placing text on arrows you can use quotes library too.
    – Zarko
    Jan 8 '17 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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