# Using TikZ, how to draw planes non simple curves (self-intersecting curves)?

I can't draw planes simple curves (other than circles or ellipses), closed as these

• Possible duplicate: tex.stackexchange.com/questions/17181/… – Andrew Jun 18 '15 at 10:13
• Excuse me, I think the curves drawn there are curves in spaces – benedito Jun 18 '15 at 10:28
• @Andrew I'd say no: knots and curves are not the same thing. – egreg Jun 18 '15 at 10:29
• In Metapost the first one is as simple as drawarrow origin {left} .. 34 down {right} .. 10 up .. 21 down .. cycle; Can you do something like that in TikZ with the hobby package? – Thruston Jun 18 '15 at 11:42
• @Thruston Yes. Posted an answer with that. – Alenanno Jun 18 '15 at 13:52

As it was suggested to you in the comments, you can use the hobby Tikz library and use the option [closed hobby] in the draw options. Notice that it follows the same syntax of a plot by using coordinates (it is a plot, after all).

## Code

\documentclass[tikz,margin=10pt]{standalone}
\usetikzlibrary{hobby}

\begin{document}
\begin{tikzpicture}
\draw[closed hobby] plot coordinates {(0,0) (1,1) (0,1) (.5,.3) (.5,.7) (0,0)};

\begin{scope}[xshift=3cm]
\draw[closed hobby] plot coordinates {(0,0) (1,1) (2,0) (2,1)};
\end{scope}
\end{tikzpicture}
\end{document}