Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=4cm,
                thick,main node/.style={circle,draw,font=\Large\bfseries}]

  \node[main node] (1) {1};
  \node[main node] (2) [below left of=1] {2};
  \node[main node] (3) [below right of=1] {3};

  \path
    (1) edge [loop above] node {0.6} (1)
        edge [bend right] node {0.4} (2)
    (2) edge node [below]{1.0} (1)
    (3) edge [loop below] node {0.8} (3)
        edge node[right] {0.1} (1)
        edge node[below] {0.1} (2);      
\end{tikzpicture}

Output:

What I want is loop with 0.8 to be placed as I drawn in red (something between right and below option).
How can I do that?
I tried (3) edge [loop below right] node {0.8} (3) and it didn't work.

share|improve this question
1  
I find this good also [node loop with angle][1] [1]: tex.stackexchange.com/questions/20259/… –  Wassim Sboui Jun 17 '12 at 20:26

2 Answers 2

up vote 13 down vote accepted

For example, specifying angles for in and out:

\draw (3) to [out=330,in=300,looseness=8] (3);

loop

share|improve this answer

In tkz-graph, the loop is placed with dir=SOEA south east

Picture

enter image description here

Code

\documentclass{article}
\usepackage{tkz-graph}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,thick]
\SetGraphUnit{3} 
\tikzset{VertexStyle/.style = {draw,circle,thick,
                               minimum size=1cm,
                               font=\Large\bfseries},thick} 
\Vertex{1} \SOWE(1){2} \SOEA(1){3} 
\Edges(3,2,1) \Edge(3)(1)

\Loop[dist=2cm,dir=NO,label=$0.6$,labelstyle=above](1)  
\Loop[dist=2cm,dir=SOEA,label=$0.8$,labelstyle=below right](3)  

\path[every node/.style={swap,auto}]    (2) to node {0.1} (1)
                                            to node {0.1} (3)
                                            to node {0.1} (2); 
\draw[->] (1) to [bend right] node [above left] {0.4} (2);
% it's possible with \Edge but Tikz's syntax is allowed too.
\end{tikzpicture} 
\end{document} 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.