I am new to LaTeX and also the forum.
For my master's thesis I need a game tree. I want to label the branches with probabilites. On this forum, I found that most people would use "edge from parent node" within the tikz environment. However, for me it does not work. The command shifted the origin of the following branches to the middle of the branch above. I would like to have someting like shown in the top picture, what I am getting currently is the bottom picture. Does anyone know how to fix it?
This is my code:
\documentclass{article} \usepackage[a4paper,top=2cm,bottom=2cm,left=2cm,right=2cm,marginparwidth=1.35cm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\tikzstyle{level 1}=[level distance=15mm,sibling distance=6cm]
\tikzstyle{level 2}=[level distance=15mm,sibling distance=60mm]
\tikzstyle{level 3}=[level distance=15mm,sibling distance=50mm]
\tikzstyle{level 4}=[level distance=15mm,sibling distance=40mm]
\tikzstyle{level 5}=[level distance=15mm,sibling distance=30mm]
\tikzstyle{level 6}=[level distance=15mm,sibling distance=20mm]
\node(0){Deviate or Collude}
child{node{Deviate}
child{node{$R_{dev}$ - EDC}
child{node{$R_{comp}$*$\delta$}
child{node{$R_{comp}$*$\delta^2$}
child{node{$R_{comp}$*$\delta^3$}
child{node{...}}
}}}}}
child{node{Collude}
child{node{$R_{cartel}$ - EDC - F}edge from parent node{$\alpha$}[left]
child{node{$R_{comp}$*$\delta$}
child{node{$R_{comp}$*$\delta^2$}
child{node{$R_{comp}$*$\delta^3$}
child{node{...}
}}}}}
child{node{$R_{cartel}$}
child{node{($R_{cartel}$-EDC-F)*$\delta$}
child{node{$R_{comp}$*$\delta^2$}
child{node{$R_{comp}$*$\delta^3$}
child{node{...}}}}}
child{node{$R_{cartel}$*$\delta$}
child{node{($R_{cartel}$- EDC - F)*$\delta^2$}
child{node{$R_{comp}$*$\delta^3$}
child{node{...}
}}}
child{node{$R_{cartel}$*$\delta^2$}
child{node{($R_{cartel}$- EDC - F)*$\delta^3$}
child{node{...}}}
child{node{$R_{cartel}$*$\delta^3$}
child{node{...}}
child{node{...}}}
}}}
};
\end{tikzpicture}
\end{document}
istgame
or a specialised tree package:forest
ortikz-qtree
. It would make your life much easier :). By the by,\tikzstyle
is deprecated.