label

type: lblString, default: "\N" (nodes) , "" (otherwise)

Text label attached to objects.

If a node’s shape is record, then the label can have a special format which describes the record layout.

Note that a node’s default label is "\N", so the node’s name or ID becomes its label.

Technically, a node’s name can be an HTML string but this will not mean that the node’s label will be interpreted as an HTML-like label. This is because the node’s actual label is an ordinary string, which will be replaced by the raw bytes stored in the node’s name.

To get an HTML-like label, the label attribute value itself must be an HTML string.

Example: Van Gogh Paintings
graph {
  label="Vincent van Gogh Paintings"

  subgraph cluster_self_portraits {
    label="Self-portraits"

    spwgfh [label="Self-Portrait with Grey Felt Hat"]
    spaap [label="Self-Portrait as a Painter"]
  }
  
  subgraph cluster_flowers {
    label="Flowers"

    sf [label="Sunflowers"]
    ab [label="Almond Blossom"]
  }
}
Valid on:
  • Clusters
  • Edges
  • Graphs
  • Nodes
Last modified June 26, 2021 : Make attribute defaults code blocks (98194b2)