W3cubDocs

/Graphviz

sides

Number of sides when shape=polygon

type: int, default: 4, minimum: 0

Example: Polygons with 3-6 sides
graph {
  Triangle  [shape=polygon sides=3]
  Rectangle [shape=polygon sides=4]
  Pentagon  [shape=polygon sides=5]
  Hexagon   [shape=polygon sides=6]
}
Valid on:
  • Nodes

© 2025 The Graphviz Authors
Licensed under the Eclipse Public License 1.0.
https://www.graphviz.org/docs/attrs/sides/