[Tex/LaTex] Plot using Hobby

hobbytikz-pgf

Help me to plot the following plot using Hobby.
enter image description here

I have tried to plot it. My code is

\begin{tikzpicture}[use Hobby shortcut]
 \draw (-.3 ,1).. (0, 0) .. ( 1.2 , 0 ) .. ( 0 , 0 ) .. (-.3 ,-1);
 \draw (.45, 0) .. ( .9 , 0 ) .. ( .6 , 0 ) .. ( .7 , -0.01);
\draw  (-.15, 1.2).. (-.01, .2) ..(.01, .22).. (.6, .1) .. ( 1.3 , 0 ) .. ( 0 , -.1 ) .. (-.3 ,-1.2);
\node[inner sep=1pt,circle,fill=black] at  ( .7 , -0.01) {};
\end{tikzpicture}

Please correct my code to get the desired fig. Also I want to write HL adjacent to the Fig.

Best Answer

The figure can be written as in the following example.

  • The arrow tips are placed as decoration markings. See the answer of Alain Matthes and section 30.5.1 Arrow Tip Markings of the TikZ & PGF manual.

  • Styles are defined to make the \draw commands more compact:

    • Style /my marks collect the arrow mark settings via option mark.
    • arrow mark and reversed arrow mark sets an arrow tip or an arrow tip in reversed direction. The mark option setting is stored in /my marks.
    • Style do marks installs the decoration with the arrow tip markings on the path. It used /my marks,therefore it must be specified after (reversed) arrow mark.
  • The label "HL" is put right below the drawing, flushed to the right.

  • BTW, the vertical coordinate values are flipped, therefore the y unit is set to a negative value (y=-1bp).

    (I had taken the coordinates from the image positions in gimp, where the vertical positions go from the top to the bottom.)

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{
  decorations,
  decorations.markings,
  hobby,
}

\begin{document}
  \begin{tikzpicture}[
    x=1bp,
    y=-1bp,
    use Hobby shortcut,
    every circle/.style={radius=2},
    thick,
    my marks/.style={},
    arrow mark/.style={
      /my marks/.append style={
        mark=at position #1 with {\arrow[ultra thick]{stealth}},
      },
    },
    reversed arrow mark/.style={
      /my marks/.append style={
        mark=at position #1 with {\arrowreversed[ultra thick]{stealth}},
      },
    },
    do marks/.style={
      decorate,
      postaction={
        decoration={
          markings,
          /my marks,
        },
        decorate,
      },
    },
  ]
    \fill (60,57) circle;
    \draw[
      arrow mark=.14,
      do marks,
    ]
      (34,56)..(53,44)..(64,45)..(73,57)..(60,68)..(49,61)..(54,53)
    ;
    \draw[
      arrow mark=1,
      do marks,
      shorten >=1pt,
    ]
      (134,83)..(117,75)..(86,91)..(51,103)..(1,58)..(53,12)..(87,18)..
      (113,25)..(148,0)
    ;
    \fill (118,50) coordinate (cross) circle;
    \draw[
      arrow mark=.06,
      reversed arrow mark=.24,
      reversed arrow mark=.78,
      arrow mark=.92,
      do marks,
    ]
      (152,86)..(cross)..(59,26)..(21,56)..(55,84)..(cross)..(152,11)
    ;
    \node[
      below left,
      inner sep=0pt,
      outer sep=0pt,
      font=\sffamily,
    ] at (current bounding box.south east) {HL};
  \end{tikzpicture}
\end{document}

Result