2

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

benedito
  • 4,600

1 Answers1

5

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).

Output

figure 1

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}
Alenanno
  • 37,338