9

How can I draw a dashed loop in TikZ? I tried

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \node (X) [circle, draw] {X};
  \draw (X) to [in=60, out=120, dashed, loop] ();
\end{tikzpicture}
\end{document}

Unfortunately, the loop only "listens" to the options in and out, but not to dashed. The resulting loop is not dashed:

enter image description here

15

Well it seems you messed with drawing arguments. If you do

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \node (X) [circle, draw] {X};
  \draw[dashed] (X) to [in=60, out=120, loop] ();
\end{tikzpicture}
\end{document}

You'll get a nice dashed loop:

enter image description here

  • 1
    Thank you for the answer, which fixes my problem, and to Jubobs for the pictures. – Bruno Le Floch Jun 15 '14 at 19:55

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.