graphNEL
object, an igraph
object, or
a descriptive vector.plotGraph(a, dashed = FALSE, tcltk = TRUE, layout = layout.auto,
directed = FALSE, noframe = FALSE, nodesize = 15, vld = 0, vc = "gray",
vfc = "black", colbid = "FireBrick3", coloth = "black", cex = 1.5, ...)
TRUE
the bi-directed edges are plotted as
undirected dashed edges.TRUE
the function opens a tcltk device to plot the graphs, allowing the interactive manimulation of the graph. If FALSE
the function opens a standard device without interaction.layout.auto
. This can be further adjusted if tcltk
is TRUE
.FALSE
a symmetric adjacency matrix with entries 1
is interpreted as an undirected graph. If FALSE
it is interpreted as a directed graph
with double arrows. If a
is not an adjacency matrix, it is iTRUE
, then the nodes are not circled.plot
or tkplot
.tkp.id
,
graph
, the input graph as an igraph
object.
The id can be used to get the layout of the adjusted graph.
The bi-directed edges are plotted in red.plotGraph
uses plot
and tkplot
in grMAT
, tkplot
, drawGraph
,
plot.igraph
exvec<-c("b",1,2,"b",1,14,"a",9,8,"l",9,11,
"a",10,8,"a",11,2,"a",11,9,"a",11,10,
"a",12,1,"b",12,14,"a",13,10,"a",13,12)
plotGraph(exvec)
############################################
amat<-matrix(c(0,11,0,0,10,0,100,0,0,100,0,1,0,0,1,0),4,4)
plotGraph(amat)
plotGraph(makeMG(bg = UG(~a*b*c+ c*d), dg = DAG(a ~ x + z, b ~ z )))
plotGraph(makeMG(bg = UG(~a*b*c+ c*d), dg = DAG(a ~ x + z, b ~ z )), dashed = TRUE)
# A graph with double and triple edges
G <-
structure(c(0, 101, 0, 0, 100, 0, 100, 100, 0, 100, 0, 100, 0,
111, 100, 0), .Dim = c(4L, 4L), .Dimnames = list(c("X", "Z",
"Y", "W"), c("X", "Z", "Y", "W")))
plotGraph(G)
# A regression chain graph with longer labels
plotGraph(makeMG(bg = UG(~Love*Constraints+ Constraints*Reversal+ Abuse*Distress),
dg = DAG(Love ~ Abuse + Distress, Constraints ~ Distress, Reversal ~ Distress,
Abuse ~ Fstatus, Distress ~ Fstatus),
ug = UG(~Fstatus*Schooling+ Schooling*Age)),
dashed = TRUE, noframe = TRUE)
# A graph with 4 edges between two nodes.
G4 = matrix(0, 2, 2); G4[1,2] = 111; G4[2,1] = 111
plotGraph(G4)
Run the code above in your browser using DataLab