Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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}

enter image description here

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.