Skip to contents

Replaces the current plot function used when drawing term figures. The function must accept netobj, layout, vcolor, ecolor, directed, and .... Setting a plot function invalidates previously cached term figures, so subsequent renders use the new function.

Usage

tabulergm_set_plotfun(plotfun)

Arguments

plotfun

A function with signature function(netobj, layout, vcolor, ecolor, directed, ...).

Value

Invisibly returns the previous plot function.

Examples

my_plotfun <- function(netobj, layout, vcolor, ecolor, directed, ...) {
  netplot::nplot(netobj, vertex.color = vcolor, edge.color = ecolor,
                 layout = layout)
}
old <- tabulergm_get_plotfun()
tabulergm_set_plotfun(my_plotfun)
# Restore the previous plot function
tabulergm_set_plotfun(old)