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.

Is there a simple way to achieve this type of graph?

enter image description here

Obviously a lot neater than this... But the important feature is the join between the two children of P.

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

You should study pgfmanual (v2.10 as of mine) for trees library (sections 18.Making Trees Grow, 53.Tree Library) and placing nodes on a line or curve (sections 16.8 and 16.9).

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[level distance=1.5cm, grow=down,
    every node/.style={draw, circle, thin},
    edge from parent/.style={-latex, thick, draw}
]
\node (P) {P}
    child {node (Q) {Q}
        child {node (T) {T}}
        child {node (U) {U}}
    }
    child {node (R) {R}}
    child {node (S) {S}};

\path (P) -- coordinate[midway] (PQ) (Q);
\path (P) -- coordinate[midway] (PR) (R);

\draw (PQ) to[bend right=22] (PR);
\end{tikzpicture}
\end{document}

Code output

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