View source: R/frontend-plot.R
plot.bn | R Documentation |
Plot the graph associated with a small Bayesian network.
## S3 method for class 'bn'
plot(x, ylim = c(0,600), xlim = ylim, radius = 250,
arrow = 35, highlight = NULL, color = "red", ...)
x |
an object of class |
ylim |
a numeric vector with two components containing the range of the y-axis. |
xlim |
a numeric vector with two components containing the range of the x-axis. |
radius |
a numeric value containing the radius of the nodes. |
arrow |
a numeric value containing the length of the arrow heads. |
highlight |
a vector of character strings, representing the labels of the nodes (and corresponding arcs) to be highlighted. |
color |
an integer or character string (the highlight colour). |
... |
other graphical parameters to be passed through to plotting functions. |
The following arguments are always overridden:
axes
is set to FALSE
.
xlab
is set to an empty string.
ylab
is set to an empty string.
Marco Scutari
graphviz.plot
.
data(learning.test)
cpdag = pc.stable(learning.test)
plot(cpdag)
## highlight node B and related arcs.
plot(cpdag, highlight = "B")
## highlight B and its Markov blanket.
plot(cpdag, highlight = c("B", mb(cpdag, "B")))
## a more compact plot.
par(oma = rep(0, 4), mar = rep(0, 4), mai = rep(0, 4),
plt = c(0.06, 0.94, 0.12, 0.88))
plot(cpdag)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.