This function is a wrapper function for plot.igraph
, with 2 main additions.
1. Add the ability to color vertices by their attributes (see examples), accompanied by an inofrmative
legend. 2. Resize vertex.size, edge.arrow.size, label.cex according to the plot size and the size of the
network.
plotNetwork(
graph,
vertex.color,
col.palette = palette(),
layout = layout.auto,
legend = TRUE,
...
)
An annotated igraph object.
A list of colors for vertices, or an attribute names (ex: "pathway") by which vertices
will be colored. Complex attributes, where a vertex belongs to more than one group, are supported. This can
also be the output of colorVertexByAttr
.
A color palette, or a palette generating function (ex:
col.palette=rainbow
).
Either a graph layout function, or a two-column matrix specifiying vertex coordinates.
Wheter to plot a legend. The legend is only plotted if vertices are colored by attribute values.
Additional arguments passed to plot.igraph
.
Produces a plot of the network.
Other Plotting methods:
colorVertexByAttr()
,
layoutVertexByAttr()
,
plotAllNetworks()
,
plotClassifierROC()
,
plotClusterMatrix()
,
plotCytoscapeGML()
,
plotPathClassifier()
,
plotPaths()
data("ex_kgml_sig")
plotNetwork(ex_kgml_sig, vertex.color="pathway")
#> This graph was created by an old(er) igraph version.
#> ℹ Call `igraph::upgrade_graph()` on it to use with the current igraph version.
#> For now we convert it on the fly...
plotNetwork(ex_kgml_sig, vertex.color="pathway", col.palette=heat.colors)
plotNetwork(ex_kgml_sig, vertex.color="pathway",
col.palette=c("red", "green","blue","grey"))