\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.
Best Answer
Does this illustration help to understand the relation between path operators (like
--
and-|
) and thepos
key?For the last example, your will need my
paths.ortho
library which has been developed for this reason (amongst others).Code
Output