Skip to content
Graphviz (DOT) templates

Linguistic Parse Tree

CFG parse tree for an English sentence.

Template previewGraphviz (DOT)
Rendering…

Make it your own.

digraph parse {
  rankdir=TB;
  graph [bgcolor=transparent];
  node [shape=plain, fontname=Inter, fontsize=11];
  edge [arrowhead=none];

  S [label="S"];
  NP1 [label="NP"]; VP [label="VP"];
  DT1 [label="DT"]; NN1 [label="NN"];
  V [label="V"]; NP2 [label="NP"];
  DT2 [label="DT"]; NN2 [label="NN"];

  S -> NP1; S -> VP;
  NP1 -> DT1; NP1 -> NN1;
  DT1 -> "The"; NN1 -> "scientist";
  VP -> V; VP -> NP2;
  V -> "presented";
  NP2 -> DT2; NP2 -> NN2;
  DT2 -> "a"; NN2 -> "paper";
}