1

I have the following curve in an instance of Tikz:

\draw[->,snake=snake, segment amplitude=.2mm, segment length=1.5mm, line after snake=0.5mm] (2.8,0.9) -- (2.4,0.9);

Since Tikz's library Snakes has been superseeded by decorations, I would like to do the same drawing with decorations.pathmorphing. However I don't know how to do it. I would appreciate some help.

1 Answer 1

1

Based on p. 356 of the pgfmanual

enter image description here

I propose

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{snakes,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\draw[->,snake=snake, segment amplitude=.2mm, segment length=1.5mm, line after snake=0.5mm] (2.8,0.9) -- (2.4,0.9);

\draw[->,decorate,decoration={coil,aspect=0,amplitude=.2mm, segment
length=1.5mm,post length=0.5mm}] (3.8,0.9) -- (3.4,0.9);

\end{tikzpicture}
\end{document}

enter image description here

2
  • Do you have any idea of how to make these two arrows look more similar? I tried to lower the post lenght but it doesn't work/
    – Gabriel
    Dec 1, 2018 at 15:58
  • 1
    \draw[->,decorate,decoration={snake,aspect=0,amplitude=.2mm, segment length=1.5mm,post length=0.5mm}] (2.8,0.9) -- (2.4,0.9); works beautifully! Thanks @marmot
    – Gabriel
    Dec 1, 2018 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .