W3cubDocs

/Graphviz

_background

A string in the xdot format specifying an arbitrary background

type: xdot, default: <none>

During rendering, the canvas is first filled as described in the bgcolor attribute.

Then, if _background is defined, the graphics operations described in the string are performed on the canvas.

See xdot format page for more information.

Render a red square in the background
digraph G {
  _background="c 7 -#ff0000 p 4 4 4 36 4 36 36 4 36";
  a -> b
}
Valid on:
  • Graphs

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