\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[level distance=1.5cm,
level 1/.style={sibling distance=3.5cm},
level 2/.style={sibling distance=1cm},
edge from parent fork down]
\tikzstyle{every node}=[circle,draw]
\node (Root) [red] {3}
child {
node {1}
child { node {4} edge from parent node[above,draw=none] {help!} }
child { node {1} }
child { node {3} }
}
child {
node {2}
child { node {3} }
child { node {2} }
child { node {5} }
};
\end{tikzpicture}
\end{document}
yields
but I'd like to add textual labels the positions marked with the red and blue text below.
This post somewhat addresses the red issue but not the blue issue.
Getting the (horizontally running) text along that first, short line before it splits is what is giving me the most trouble.
It seems that first stem needs to be taller to allow room for a label there, especially when the right branch will have its own label.
pos
key to change the position of a node along a path (in this case only on the horizontal part and the vertical part at the child node). Theedge from parent
operator needs to be given after all children.