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

Setting the shape attribute for all nodes

Using the statement node [shape = box] sets the shape attribute to box for all nodes in a digraph:
digraph {
   node [shape = box]

   ‥ /* Notes and edges */
}

See also

Graphviz attributes
Graphviz

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/tools/Gr...', 1743451696, '18.191.35.15', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/tools/Graphviz/attributes/shape/index(126): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78