Description Usage Arguments Value Examples
Global layout style:
Large complex networks can be plotted using the fruchterman-reingold algorithm, the Kamada-kawai algorithm or any given input function by applying these algorithms to the minimum spanning tree (MST). The edges of the minimum spanning tree are shown in black, all other edges are shown in colors which are a function of the distances between the coordinates of the nodes.
1 2 3 4 5 6 7 | mst.plot.mod(x, layout.function=NULL,colors=NULL,
mst.edge.col="white", vertex.color = "skyblue",
tkplot=FALSE,expression=NULL, v.size=FALSE, e.size=FALSE,
mst.e.size=1, edge.col.wt=NULL, v.lab=FALSE, e.lab=NULL,
bg="black",v.lab.cex=0.5, e.lab.cex=0.5,v.lab.col="blue",
lab.dist=0, e.lab.col="blue",v.sf=c(3,12), sf=0,
e.arrow=.2, layout.overall=NULL)
|
x |
|
layout.function |
|
layout.overall |
|
mst.edge.col |
This option assigns a color to the edges of the minimum spanning tree of graph 'g'. If mst.edge.col = NULL, then the default color is black for 'tkplot=TRUE'. If 'tkplot=FALSE' it is white. |
colors |
|
vertex.color |
|
expression |
|
tkplot |
|
v.size |
is a numeric value or a numeric vector which contains values to assign the size of the nodes. |
e.size |
is a numeric value or a numeric vector which contains values to assign the width of edgesother than the minimum spanning tree edges of the graph. |
mst.e.size |
is a numeric value which assigns the edge width to the edges of minimum spanning tree of the input graph. |
v.lab |
is a logical value to show vertex label. |
e.lab |
is logical value to show edge labels. |
bg |
is a character value to color the background. |
v.lab.cex |
is a numerical value to set the font size of the vertex labels. |
e.lab.cex |
is a numerical value to set the font size of the edge labels. |
lab.dist |
is a numerical value to adjust the distance of labels from the nodes. |
v.lab.col |
is a hexadecimal value or a character name of a color to assign colors to the vertex labels. |
e.lab.col |
is a hexadecimal character value to assign colors to the edge labels. |
e.arrow |
is a inumerical value to set the arrow width in a directed network. |
v.sf |
is a 2 dimensional numeric vector, which represents the minimum and maximum limits of the size of the vertices. This is used to adjust the vertex size when the option |
sf |
is a numeric value. It is a scaling factor used to scale-up or scale-down the abstract graph. |
edge.col.wt |
is a vector of numeric values provided for each edge. This is used to color the edges from blue to red from high to low values. |
... |
|
This function plots the graph object given as an input using 'tkplot' or 'plot' function available in 'igraph' package.
This function returns a netbiov
class object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ## Example 1 ####
g <- barabasi.game(2000, directed=FALSE)
id <- mst.plot.mod(g)
## Example 2 ####
### plotting a graph by combining two algorithms ##%
fn <- function(g){layout.reingold.tilford(g,
circular=TRUE, root=which.max(degree(g)))}
id <- mst.plot.mod(g, v.size=1, sf=-20, layout.function=fn,
layout.overall=layout.fruchterman.reingold, mst.e.size=2,
vertex.color="darkgreen")
data("PPI_Athalina")
id <- mst.plot.mod(g1, v.size=1, sf=0, layout.function=fn,
layout.overall=layout.fruchterman.reingold, mst.e.size=1,
vertex.color="magenta", colors=heat.colors(20))
## Example 3 ####
## When expression values of genes or nodes
## are given and to be plotted as a color of vertices ###
id <- mst.plot.mod(g1, expression=rnorm(vcount(g1)), v.size=1)
## Example 4 ####
## When expression values of genes or nodes are given
## and to be plotted as a color of vertices,
## also the degree of nodes to be shown as their vertex-size ###
id <- mst.plot.mod(g1, expression=rnorm(vcount(g1)),
v.size=degree(g1), v.sf=c(1,5))
## Example 5 ####
## When MST edges are highlighted in purple color and rest
## of the edges are plotted with a range of heat colors
## depending on the distance between nodes ###
id <- mst.plot.mod(g1, mst.edge.col="purple",
colors=heat.colors(20), vertex.color="yellow", v.size=1)
## Example 6 ####
## Plotting a graph with kamada-kawai layout algorithm ###
id <- mst.plot.mod(g1, mst.edge.col="purple",
colors=heat.colors(20), vertex.color="white", v.size=1,
layout.function=layout.kamada.kawai)
## Example 7 ####
## Plotting a graph with when weights of edges are given ###
id <- mst.plot.mod(g1, mst.edge.col="purple", edge.col.wt =
runif(ecount(g1), min=1, max=10), vertex.color="yellow", v.size=
1, layout.function=layout.kamada.kawai)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.