2

I have the following simple code:

\documentclass[notitlepage]{report}
\usepackage{tikz}
\usetikzlibrary{snakes}
\begin{tikzpicture}
    \draw[line width=2pt] (0,0) to (0,4) node[above]{\text{D1}};
    \draw[line width=2pt] (0,0) to (4,0) node[right]{\text{D3}};
    \filldraw (0,0) circle (3pt);
    \draw[snake=coil,segment aspect=0, line width=1.5pt, red] (0,1)  -- (1,0); 
    \draw[snake=coil,segment aspect=0, line width=1.5pt, green] (1.5,0) arc (180:0:1cm);
\end{tikzpicture}

I want to make the arc to be snaky as the other red line. However, the code does not work. How can I make the green arc snaky?

  • Dear @percusse, thank you very much, it works! – QGravity Nov 9 '17 at 4:01
  • 1
    @percusse Would you like to write an answer? – CarLaTeX Nov 9 '17 at 5:19
  • @percusse, just another question: is it possible to adjust the segment aspect=0 for the arcs? – QGravity Nov 11 '17 at 6:15
  • @QGravity Yes, you can find examples in the manual. – percusse Nov 18 '17 at 3:50
  • 1
    TikZ/pgf manual – percusse Nov 18 '17 at 10:53
2

snake=coil is a lucky miss such that snake is defined as the name of decoration and because of that supplying a value doesn't cause anything to happen. Hence if you fix the decoration name then it works. Hence instead of snake=coil use decoration=snake,decorate

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.