Sign up ×
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

2 Answers 2

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).

\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);

Code output

share|improve this answer

This solution uses the powerful forest package together with the angles library of PGF/TikZ.

A special style, tree angle is defined which marks the angle between a child node and the next sibling.

The combination allows the tree itself to be specified very concisely:

\usetikzlibrary{arrows.meta, angles}
  tree angle/.style={
    tikz={\path () coordinate (A) -- (!u) coordinate (B) -- (!n) coordinate (C) pic [draw] {angle};}
  for tree={
    l sep+=7.5pt
  [Q, tree angle
      [T, tree angle]
      [W, tree angle]

tree angles in a forest

share|improve this answer

Your Answer


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.