Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

08 Sep '14, 13:13

esdd's gravatar image

esdd
17.8k304257

Erstellen eines Baumes mit Tikz

Liebes Forum, ich habe eine Frage zur Erstellung von Baeumen. Ich habe es bereits geschafft, meinen Baum zu Erstellen, bin auch recht zufrieden damit, brauche aber jetzt noch eine vertikale, gestrichelte Linie zwischen den beiden Knoten B und C. Weiss vielleicht jemand, ob das moeglich ist und wenn ja, wie? Mein bisheriger Code sieht wie folgt aus: \documentclass[12pt, a4paper, bibliography=totoc, abstracton]{scrartcl} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} \begin{figure} % Set the overall layout of the tree \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm] \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm] % Define styles for bags and leafs \tikzstyle{bag} = [text width=4cm, text centered, inner sep=1pt] \tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt] \begin{tikzpicture}[grow=right, sloped] \tikzset{frontier/.style={distance from root=150pt}} \node {A} child { node[bag] {C} child { node[end, label=right: {$G (2,2)$}] {} edge from parent node[above] {} node[below] {$s_{22}$} } child { node[end, label=right: {$F (4,1)$}] {} edge from parent node[above] {$s_{21}$} node[below] {} } edge from parent node[above] {} node[below] {$s_{12}$} } child { node[bag] {B} child { node[end, label=right: {$E (1,4)$}] {} edge from parent node[above] {} node[below] {$s_{22}$} } child { node[end, label=right: {$D (3,3)$}] {} edge from parent node[above] {$s_{21}$} node[below] {} } edge from parent node[above] {} node[below] {$s_{12}$} }; \end{tikzpicture} \end{figure} \end{document} Vielen Dank im Voraus. Liebe Gruesse, Katja.
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

19 Aug '14, 17:04

KatjaBachelorThesis's gravatar image

KatjaBachelorThesis
23112

Erstellen eines Baumes mit Tikz

Liebes Forum, ich habe eine Frage zur Erstellung von Baeumen. Ich habe es bereits geschafft, meinen Baum zu Erstellen, bin auch recht zufrieden damit, brauche aber jetzt noch eine vertikale, gestrichelte Linie zwischen den beiden Knoten B und C. Weiss vielleicht jemand, ob das moeglich ist und wenn ja, wie? Mein bisheriger Code sieht wie folgt aus: \documentclass[12pt, a4paper, bibliography=totoc, abstracton]{scrartcl} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} \begin{figure} % Set the overall layout of the tree \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm] \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm] % Define styles for bags and leafs \tikzstyle{bag} = [text width=4cm, text centered, inner sep=1pt] \tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt] \begin{tikzpicture}[grow=right, sloped] \tikzset{frontier/.style={distance from root=150pt}} \node {A} child { node[bag] {C} child { node[end, label=right: {$G (2,2)$}] {} edge from parent node[above] {} node[below] {$s_{22}$} } child { node[end, label=right: {$F (4,1)$}] {} edge from parent node[above] {$s_{21}$} node[below] {} } edge from parent node[above] {} node[below] {$s_{12}$} } child { node[bag] {B} child { node[end, label=right: {$E (1,4)$}] {} edge from parent node[above] {} node[below] {$s_{22}$} } child { node[end, label=right: {$D (3,3)$}] {} edge from parent node[above] {$s_{21}$} node[below] {} } edge from parent node[above] {} node[below] {$s_{12}$} }; \end{tikzpicture} \end{figure} \end{document} Vielen Dank im Voraus. Liebe Gruesse, Katja.