Search notes:

Graphviz - shape attribute

The shape attribute specifies the shape for nodes.
shape is both, the name of an attribute and the type of the attribute shape.

Main shape types

Graphviz has three (main?) types of shapes:

Some interesting shape values

Graphviz comes with a quite a list of shapes. The most interesting and useful, imho, are the following:
Comments Synonyms
box rect, rectangle
circle
cylinder
doublecircle
none not available in version 2.38 plaintext
Mrecord Creates a record based node
plain Similar to shape=none but enforces width=0 height=0 margin=0. This guarantees that the size of a node is determined by its label. Not available in version 2.38
plaintext
point
record Creates a record based node
square
underline
The default value for shape is ellipse.
digraph SomeShapes {

  edge         [ style=invis        ]

// 1
  none         [ shape=none         ]
  point        [ shape=point        ]
  box          [ shape=box          ]

// 2
  plain        [ shape=plain        ] // Does not work with dot version 2.38
  ellipse        // default
  square       [ shape=square       ]

// 3
  underline    [ shape=underline    ]
  circle       [ shape=circle       ]
  record       [ shape=record  label="{record|record based node}"  ]



// 4
// ...
  doublecircle [ shape=doublecircle ]
  Mrecord      [ shape=Mrecord label="{Mrecord|record based node}" ]

// 5
// ..
  cylinder     [ shape=cylinder     ] // Does not work with dot version 2.38



  none    -> plain   -> underline
  point   -> ellipse -> circle     -> doublecircle -> cylinder
  box     -> square  ->  record    -> Mrecord

}
Github repository about-Graphviz, path: /attributes/shape/interesting-shapes.dot

See also

Graphviz attributes
Graphviz

Index