I need to use LaTeX to create the following graph. I am just completely stuck with no idea how to get started. It seems there are some packages like TikZ that I could use to plot tree type of images, however I could not find anything to my example.
Notice that some of those are arrows, while some are just line segments. And most examples I found are vertical structure, but this one is horizontal.
Any tips would be appreciated.
We can easily start drawing our tree using by starting a node, with \node command. We need to provide its content in curly parentheses. To create child nodes, we can use child {} command as we continue in the node. All the nested children should go in the parentheses.
To provide my best suggestion I used trees
library from TikZ.
The code:
\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{trees,arrows}
\begin{document}
\tikzstyle{level 1}=[level distance=30mm, sibling distance=30mm]
\tikzstyle{level 2}=[level distance=30mm, sibling distance=15mm]
\tikzstyle{level 3}=[level distance=20mm]
\begin{tikzpicture}[grow=right,->,>=angle 60]
%\begin{scope}[yshift=0]
\node {$A_{1,1}$}
child {node {$A_{2,2}$}
child {node {$A_{3,2}$}
child[-] {node{$S^{<4>}$}}
}
child {node{$A_{3,1}$}
child[-] {node{$S^{<3>}$}}
}
}
child {node {$A_{2,1}$}
child {node{$A_{3,2}$}
child[-] {node{$S^{<2>}$}}
}
child {node{$A_{3,1}$}
child[-] {node{$S^{<1>}$}}
}
};
%\end{scope}
\begin{scope}[yshift=-6cm]
\node {$A_{1,2}$}
child {node {$A_{2,2}$}
child {node {$A_{3,2}$}
child[-] {node{$S^{<8>}$}}
}
child {node {$A_{3,1}$}
child[-] {node{$S^{<7>}$}}
}
}
child {node {$A_{2,1}$}
child {node {$A_{3,2}$}
child[-] {node{$S^{<6>}$}}
}
child {node {$A_{3,1}$}
child[-] {node{$S^{<5>}$}}
}
};
\end{scope}
\end{tikzpicture}
\end{document}
And the output, very similar to yours.
Notice how no arrows at level 3
are provided by the syntax child[-]
instead of child
(default is ->,>=angle 60
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With