Description Usage Arguments Details Value Author(s) References Examples
Methods
for class gRapHD
.
1 2 3 4 5 6 7 | ## S3 method for class 'gRapHD'
plot(x,vert=NULL,numIter=50,main="",plotVert=TRUE,plotEdges=TRUE,
energy=FALSE,useWeights=FALSE,vert.hl=NULL,col.hl="red",
vert.radii=0.01,coord=NULL,col.ed="darkgray",lty.ed=1,lwd.ed=1,
lwd.vert=1,border=0,symbol.vert=1,cex.vert.label=.40,
vert.labels=TRUE,asp=NA,disp=TRUE,font=par("font"),
col.labels=NULL,add=FALSE,...)
|
x |
a |
vert |
vector of vertices to be plotted. If |
numIter |
number of iterations for the Fruchterman-Reingold algorithm. |
main |
main title. |
plotVert |
if |
plotEdges |
if |
energy |
if |
useWeights |
if |
vert.hl |
vector of vertices to be highlighted. |
col.hl |
colour to be used in the highlighted vertices. |
vert.radii |
radii of the vertices (scalar or vector with length equal to the number of vertices). See 'Details'. |
coord |
initial coordinate values for the vertices. |
col.ed |
colour of the edges (scalar or vector). |
lty.ed |
type of line for the edges (scalar or vector). |
lwd.ed |
width of the line for the edges (scalar or vector). |
lwd.vert |
width of the vertices' border (scalar or vector). |
border |
colour of the vertices borders (scalar or vector). |
symbol.vert |
symbol to be used in the vertices (length 1 or number of vertices):
0 is a ellipse ( |
cex.vert.label |
numeric character expansion factor for the labels; multiplied by
|
vert.labels |
labels to be used in the vertices. If |
asp |
numeric, giving the aspect ratio y/x
(see |
disp |
if |
font |
an integer which specifies which font to use for the labels. If possible, device drivers let 1 correspond to plain text (the default), 2 to bold face, 3 to italic and 4 to bold italic. |
col.labels |
colour of the labels. Default is |
add |
if |
... |
further arguments passed to or from other methods. |
Plot a graph based on the list of edges.
Only one (model
or edges
) should be provided. If model
,
the function uses also the information about the type of variables (discrete
or continuous). If edges
, then all variables are plotted as continuous
(circles).
The plotting area is square, ranging from 0 to 1. The unit of parameter
vs
follow the axes.
The algorithm proposed by Fruchterman & Reingold (1991) is used to determine
the position of each vertex. It is not initialised randomly, but in a regular
grid.
The graph is always positioned in a square centred in (0.5,0.5) with sides of
length one.
The coordinates for the vertices are returned, as a matrix. This may be used
in subsequent calls to plot using the coord
argument, usually with
numIter=0
.
Gabriel Coelho Goncalves de Abreu (abreu_ga@yahoo.com.br)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
Fruchterman, T.M.J. and Reingold, E.M. (1991) Graph Drawing by Force-directed
Placement. Software-Practice and Experience, Vol. 21(11), 1129-1164.
Csardi G, Nepusz T: The igraph software package for complex network
research, InterJournal, Complex Systems 1695. 2006.
http://igraph.sf.net
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
plot(m1,numIter=1000)
# or
plot(m1,numIter=1000,plotVert=FALSE,labelVert=FALSE)
#############
r <- 3
edges <- rep(1,r)
x <- 2+r-1
edges <- c(edges,sort(rep(2:x,r-1)))
edges <- c(edges,sort(rep((x+1):(x+(x-1)*(r-1)),r-2)))
edges <- c(edges,sort(rep((x+(x-1)*(r-1)+1):(x+(x-1)*(r-1)+
(x-1)*(r-1)*(r-2)),r-3)))
edges <- cbind(edges,2:(length(edges)+1))
a <- neighbourhood(edges=edges,orig=1,rad=r)
vs <- a$v[,2]
vs <- 1/vs
vs[1] <- 2
vs <- vs/30
model <- new("gRapHD",edges=edges)
plot(model,numIter=200,col.hl=colours()[386:383][a$v[,2]+1],
vert.hl=a$v[,1],vert.radii=vs,border="black",lwd.vert=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.