Skip to content
Graphviz (DOT) templates

Commutative Diagram

A standard commutative square showing morphism composition.

Template previewGraphviz (DOT)
Rendering…

Make it your own.

digraph cd {
  rankdir=LR;
  graph [bgcolor=transparent];
  node [shape=plain, fontname=Inter, fontsize=14];
  edge [fontname=Inter, fontsize=10];

  A [label="A"]; B [label="B"];
  C [label="C"]; D [label="D"];

  A -> B [label="f"];
  A -> C [label="g"];
  B -> D [label="h"];
  C -> D [label="k"];

  { rank=same; A B }
  { rank=same; C D }
}