1
\begin{tikzpicture}[>=triangle 45,shorten >=1pt,auto,node distance=3cm]
\node[state] (moderate) {moderate};
\node[state, minimum size=2cm] (above) [below right of=moderate, xshift=1cm, yshift=-3cm] {above};
\node[state, minimum size=2cm, xshift=-1cm, yshift=-3cm] (below) [below left of=moderate] {below};
\path[->] (moderate) edge [loop above] node {\texttt{t\_high = 0, t\_low = 0}} (moderate)
    edge [bend left] node {\texttt{t\_high = 1}} (above)
    edge [bend left] node[align=center, xshift=-2cm, yshift=1cm] {\texttt{t\_low = 1}} (below)
    (above) edge [loop right] node {\texttt{t\_high = 1}} (above)
            edge [bend right] node {\texttt{t\_low = 1}} (below)
            edge [bend left] node[align=center, xshift=2.2cm, yshift=1cm] {\texttt{t\_high = 0,}\\\texttt{t\_low = 0}} (moderate)
    (below) edge [loop left] node {\texttt{t\_low = 1}} (below)
            edge [bend left] node[align=center] {\texttt{t\_high = 0,}\\\texttt{t\_low = 0}} (moderate)
            edge [bend right] node {\texttt{t\_high = 1}} (above);
\end{tikzpicture}

State machine diagram I'm trying to draw a state machine diagram with Tikz. However, the destinations of the arrows seem to be overlapping at the same point of the nodes. I would like them to space out evenly so that one can easily tell different arrows apart; how can I do that? Any help would be appreciated.

P.S. Is there a way to get these arcs flatter? They seem to be really "fat".

  • Have a look at http://tex.stackexchange.com/questions/57925. It explains how you can set the bend angle. – StefanH Dec 05 '16 at 07:54
  • @StefanH Thanks for the tip - any idea about the arrow issue? – Zhang Edison Dec 05 '16 at 07:56
  • @StefanH I mean, changing the bend angle does make the problem go away, but I'd still like to know if there's a way to fix it manually. – Zhang Edison Dec 05 '16 at 07:58
  • @ZhangEdison, what do you mean by manually? – Guilherme Zanotelli Dec 05 '16 at 07:59
  • @GuilhermeZanotelli I mean is it possible to force the ends of the arrows to be "evenly" distributed around the circle instead of cram together? – Zhang Edison Dec 05 '16 at 08:09
  • 1
    @ZhangEdison, well, they're cramming together because of the current bend angle (which is the default 30) and the whole symmetry of the drawing itself. If you want you can use edge[in=angle, out=angle] Syntax and manually specify the in and out angles... Although usually the automated solution is preffered – Guilherme Zanotelli Dec 05 '16 at 08:17
  • 1
    The nodes form a 60-60-60 triangle. Saying bend right by default means starting and ending 30 degrees to the right of the straight line. That is why you get them crammed together. Set bend angle=20 should set them evenly around the circle. – StefanH Dec 05 '16 at 08:18
  • You can also combine (below.12)edge(above.34). – Symbol 1 Dec 06 '16 at 20:17

0 Answers0