I have this fragment of matapost code which draw a smooth curve through points using .. operation


z0 = (0,0);
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
z4 = (30,50);
path p;
p = z0..z1..z2..z3..z4..cycle;
draw p; 


Which produce a nice closed smooth line ( compiled with pdflatex --shell-escape )

enter image description here

I would like to draw the above picture with tikz, and I do not want to use ..controls operation. I want the simplest way to draw a smooth closed line such as the picture.


1 Answer 1


You can use the hobby package (or TikZ library):

\begin{tikzpicture}[use Hobby shortcut]
  (0,0) coordinate (z0)
  (60,40) coordinate (z1)
  (40,90) coordinate (z2)
  (10,70) coordinate (z3)
  (30,50) coordinate (z4);
  \draw[closed] (z0) .. (z1) .. (z2) .. (z3) .. (z4);

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.