I have a problem with a tree in TiKz.
The last branches of two nodes are crossing each other.
I tried it with adding the line
\tikzstyle{level 3}=[sibling angle=30]
but it doesnt work.(The other angle lines are just to see if something happend ...).
How can I adjust the angles of the branches?
Heres my tree code:
Code: Select all
\tikzset{
treenode/.style = {align=center, inner sep=0pt, text centered,
font=\sffamily},
arn_n/.style = {treenode, circle, white, font=\sffamily\bfseries, draw=black,
fill=black, text width=1.5em},% arbre rouge noir, noeud noir
arn_r/.style = {treenode, circle, black, draw=black,
text width=1.5em, thin},% arbre rouge noir, noeud rouge
arn_x/.style = {treenode, rectangle, draw=black,
minimum width=0.5em, minimum height=0.5em}% arbre rouge noir, nil
}
\begin{center}
\tikzstyle{level 1}=[sibling angle=120]
\tikzstyle{level 2}=[sibling angle=60]
\tikzstyle{level 3}=[sibling angle=30]
\begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 7cm/#1,
level distance = 1.5cm}]
\node [arn_r] {$n$}
child{ node [arn_r] {$\frac{2}{3}n$}
child{ node [arn_r] {$\frac{4}{9}n$}
child{ node [arn_r] {$\frac{8}{27}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}}
child{ node [arn_r] {$\frac{4}{27}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}}
}
child{ node [arn_r] {$\frac{2}{9}n$}
child{ node [arn_r] {$\frac{4}{27}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}}
child{ node [arn_r] {$\frac{2}{27}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}}
}
}
child{ node [arn_r] {$\frac{1}{3}n$}
child{ node [arn_r] {$\frac{2}{9}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}
}
child{ node [arn_r] {$\frac{1}{9}n$}
child {node {$\vdots$}}
child {node {$\vdots$}}
}
}
;
\end{tikzpicture}
\end{center}