# How to generate labels next to junctions and avoid self-collision with tikz?

I have an ASCII-art phylogenetic tree that looks (in part) like

                 /------ PLN
/-----+ 0.9
|     \------ IL1
/--------+ 1.8
|        |      /----- PVD
|        \------+ 0.8
|               \----- URYD
--+ 3.1
|                /----- PHB
|             /--+ 0.7
|             |  \----- FLP
\-------------+ 0.8
\----- PQR


I think I understand how to use the level distance command on the children to get different depths on each side of the branch, and the grow right command to get the tree in the proper orientation, but can I get the numbers to appear as shown here--to the right of the joining node? Should these be the text of some style of node, or are they labels on textless nodes, or...?

Also, as shown here, the subtrees are different from each other and asymmetric. At this point, am I better off just drawing nodes by hand without any tree, or is there an effective way to avoid collisions?

-
add comment

## 1 Answer

Textless node seems the easiest idea.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[edge from parent path={
(\tikzparentnode.east) -- ++ (2mm,0) [rounded corners] |- (\tikzchildnode.west)
}
]
\node (root) {} [grow=right]
child
child {
child {coordinate (special)}
child
};
\node[label={[inner sep=1mm]0:Label}] at (root-2) {};
\end{tikzpicture}
\end{document}


-
Thanks! This is what I ended up doing, though I had to manually keep track of the height of the two halves of each tree and use custom sibling distance on every node. (By "manually" I mean that the code that I wrote to generate the tikz commands kept track, instead of tikz doing it.) –  Rex Kerr Jan 22 '12 at 5:03
add comment