I like to replicate this Morse tree from Wikipedia with tikz
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[nodes={draw, circle}, thick]
\node{Start}
child {
node {E}
edge from parent [dotted]
child {
node {I}
edge from parent [dotted]
child {
node {S}
edge from parent [dotted]
}
child {
node {U}
edge from parent [dashed]
}
}
child {
node {A}
edge from parent [dashed]
child {
node {R}
edge from parent [dotted]
}
child {
node {W}
edge from parent [dashed]
}
}
}
child {
node {T}
edge from parent [dashed]
};
\end{tikzpicture}
\end{document}
problems
- how to prevent R and U cover each other
- how to prevent the circles themselves being dashed / dotted
Best Answer
With package
forest
, which is based ontikz
, is simpler than with puretikz
:Tree is quit wide, so my consider to rotate tree for 90 degree. For this you only need to define direction of tree growth and accordingly determined arrows direction:
and
which gives: