I have this code
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[->,>=stealth',auto,node distance=3cm,
thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]
\node[main node] (1) {a};
\node[main node] (2) [right of=1] {b};
\node[main node] (3) [right of=2] {c};
\node[main node] (4) [right of=3] {d};
\path[every node/.style={font=\sffamily\small}]
(1) edge node [right] {} (2)
(2) edge node [right] {} (3)
(3) edge node [right] {} (4)
(4) edge node [left] {} (1);
\end{tikzpicture}
\end{document}
that produces this graph:
My goal is to produce a graph like this:
Pardon the bad drawing. I tried various combinations of (4) edge node [bend left] {} (1);
and (4) edge node [loop left] {} (1);
to no avail.
Best Answer
Just to show another approach, this use case is exactly what the keys
bend left
andbend right
were created for:These keys also accept an optional
<angle>
value to simultaneously set thein
andout
keys symmetrically, so writingwill result in
If asymmetric setting of the
in
andout
keys is required, cfr's solution is the way to go.