# Plotting loops: trajectories and directions

Plotting loops: trajectories have directions. How to plot the following figures using tikz

1st I start to plot the 2nd fig using the code

\begin{tikzpicture}
\draw (3,2) ellipse (.5cm and .25cm);
\draw (2.9,1.9) to [controls=+(90:1) and +(90:1)] (3,2);
\end{tikzpicture}

To plot the last fig, I have used.

\begin{tikzpicture}
\draw  (.5,0) .. controls (3,3) and (-1,3) .. (1.5,0);
\end{tikzpicture}

But unable to plt the outer and inside curves and the arrows. Using Hobby I wrote

\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);
\end{tikzpicture}

But problem for the outer curve persists. What to do?

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

\begin{document}
\begin{tikzpicture}[
use Hobby shortcut,
vec1/.style={
decorate,
decoration={
markings,      % v-- can fine-tune arrow position and rotation
mark=at position 0.1 with {\arrow[rotate=5]{stealth}},
}
},
vec2/.style={
decorate,
decoration={
markings,      % v-- here again---fine-tune as needed
mark=at position 0.080 with {\arrow{stealth}},
mark=at position 0.206 with {\arrow{stealth reversed}},
mark=at position 0.800 with {\arrow{stealth reversed}},
mark=at position 0.930 with {\arrow{stealth}},
}
},
]
% filled points
%\fill (0,0) circle (1pt);
%\fill (2,0) circle (1pt);
\draw (0.4, 0) .. (0.8, 0.3) .. (1.0, 0) .. (0.4, 0);
\draw  (-.3 ,1).. (0, 0) .. ( 1.2 , 0 )
\draw  (-.3 ,-1).. (0, 0) .. ( 1.2 , 0 ) .. ( 0 , 0 ) ;
\draw   (.5, 0) .. ( .8 , 0 ) .. ( .6 , 0 ) .. ( .7 , -0.012);
\draw (-.1, 1)..(-.08, .7)..(-.05, .4)..( .1 , .4 )..( .7 , .6 )..( 1.4 , 0 )..( .7 , -.6 )..( .2 , -.4 )..(-.1,-.5)..(-.11 ,-.8);
\end{tikzpicture}
\end{document}

Here's a solution using hobby for the third image. This should be enough to get you started on the other two.

Code

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

\begin{document}
\begin{tikzpicture}[
use Hobby shortcut,
vec1/.style={
decorate,
decoration={
markings,      % v-- can fine-tune arrow position and rotation
mark=at position 0.1 with {\arrow[rotate=5]{stealth}},
}
},
vec2/.style={
decorate,
decoration={
markings,      % v-- here again---fine-tune as needed
mark=at position 0.080 with {\arrow{stealth}},
mark=at position 0.206 with {\arrow{stealth reversed}},
mark=at position 0.800 with {\arrow{stealth reversed}},
mark=at position 0.930 with {\arrow{stealth}},
}
},
]
% filled points
\fill (0,0) circle (1pt);
\fill (2,0) circle (1pt);

% inner loop
\draw[postaction=vec1] (-0.6,0.1) .. (0,0.4) .. (0.4,0) ..
(0,-0.4) .. (-0.25,-0.25) .. (-0.1,0.1);

% middle crossing loop
\draw[postaction=vec2] (3,-1) .. (2,0) .. (0,0.93) ..
(-0.93,0) .. (0,-0.93) .. (2,0) .. (3,1);

% outer loop
\draw[-stealth] (2.75,-1) .. (2,-0.75) .. (1.25,-1) .. (0,-1.25) ..
(-1.25,0) .. (0,1.25) .. (1.25,1) .. (2,0.75) .. (2.75,1);
\end{tikzpicture}
\end{document}

Output

• May I get code to draw the 2nd fig. I would be very happy, if you would be kind enough to send me the associate code. – user1942348 Feb 26 '14 at 18:33
• @user1942348 what specific problems are you having? It should be fairly straightforward to modify my code to produce the second image. Also, a suggestion: Please do us a favor and change your username to something more telling than "user1234". – Paul Gessler Feb 26 '14 at 18:44
• I am very much thankful of getting your help for the last figure. The specific problem is that I am unable to bend the curves smoothly as you have done. I would earnestly request you to draw the 2nd figure for me and hope that after that comparing the two, I will be able to draw other fig. SO, please favor me for the 2nd fig. – user1942348 Feb 27 '14 at 6:25
• @Paul_Gessler (Paul Gessler) Please help me this time at your earliest convenience. Thank you very much. – user1942348 Feb 27 '14 at 16:52
• @user1942348 show us (edit the question) what you've tried so far and people will be more than happy to help. – Paul Gessler Feb 27 '14 at 17:06