Plotting networks with the Rgraphviz package

Plotting network structures, and graphs more in general, is a complex process that involves laying out nodes and arcs to avoid overlaps and to make arc patterns easy to identify. Hence bnlearn leverages the de facto-standard Graphviz library through the Rgraphviz package for this task; the built-in plot() method (documented here) is extremely limited in what networks it can plot in a legible way and it should be considered as a last resort for when Rgraphviz is not available.

The main interface to Rgraphviz in bnlearn is the graphviz.plot() function (documented here), which is designed to hide much of the complexity of the underlying Rgraphviz functions. It has few arguments that allow the most common customizations, and therefore it is not as flexible as Rgraphviz. However, it is simpler to use; and it returns a graph object that can be further customised with Rgraphviz for greater flexibility.

Options shared with Rgraphviz

graphviz.plot() shares the following arguments with the functions in Rgraphviz:

  • layout:
  • shape:
  • main:
  • sub:
Last updated on Fri Apr 17 17:45:59 2020 with bnlearn 4.6-20200410 and R version 3.6.3 (2020-02-29).