Plot: Drawing a multilayer network

multinet.plottingR Documentation

Drawing a multilayer network

Description

The plot function draws a multilayer network. values2graphics is a support function translating discrete attribute values to graphical parameters.

Usage

## S3 method for class 'Rcpp_RMLNetwork'
plot(x,
layout = NULL, grid = NULL, mai = c(.1,.1,.1,.1),
layers = NULL,
vertex.shape = 21, vertex.cex = 1, vertex.size = vertex.cex, vertex.color = 1,
vertex.labels = NULL, vertex.labels.pos = 3,
vertex.labels.offset = .5, vertex.labels.cex = 1, vertex.labels.col=1,
edge.type = 1, edge.width = 1, edge.col = 1, edge.alpha=.5,
edge.arrow.length = 0.1, edge.arrow.angle = 20,
legend.x = NULL, legend.y = NULL,
legend.pch = 20, legend.cex = 0.5,
legend.inset = c(0, 0),
com = NULL, com.cex = 1,
show.layer.names=TRUE, layer.names.cex=1, ...)

values2graphics(values, output = "color")

Arguments

x

A multilayer network.

layout

A data frame indicating the position of nodes. If NULL, the function layout.multiforce.ml is used to compute it.

grid

A vector of size 2 indicating the number of rows and columns where to draw the layers.

mai

Percentage of each frame reserved as internal margin (left, top, right, bottom). This only concerns vertices: text labels can be printed inside the margin or even outside the frame depending on their offset.

layers

A vector of layer names, that determine which layers and in which order are plotted.

vertex.shape

Symbol to use for nodes, corresponding to the parameter pch of the R points function. This can either be a single character or an integer code for one of a set of graphics symbols. See ?points for more details.

vertex.size

synonim of vertex.cex.

vertex.cex

Numeric *c*haracter *ex*pansion factor; multiplied by par("cex") yields the final node size.

vertex.color

Color of the vertexes. If NULL, all vertexes in the same layer are plotted using the same color.

vertex.labels

A character vector or expression specifying the text to be written besides each node. It corresponds to the parameter labels of the R text function.

vertex.labels.pos

A position specifier for the text. Values of '1', '2', '3' and '4', respectively indicate positions below, to the left of, above and to the right of the specified coordinates. It corresponds to the parameter pos of the R text function.

vertex.labels.offset

When vertex.labels.pos is specified, this value gives the offset of the label from the specified coordinate in fractions of a character width. It corresponds to the parameter offset of the R text function.

vertex.labels.cex

Numeric *c*haracter *ex*pansion factor; multiplied by 'par("cex")' yields the final character size. 'NULL' and 'NA' are equivalent to '1.0'. It corresponds to the parameter cex of the R text function.

vertex.labels.col

Color of the labels.

edge.type

Edge line type, corresponding to the 'lty' parameter of the R par function. Line types can either be specified as an integer (0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash) or as one of the character strings '"blank"', '"solid"', '"dashed"', '"dotted"', '"dotdash"', '"longdash"', or '"twodash"', where '"blank"' uses 'invisible lines' (i.e., does not draw them). See ?par for more details. It accepts a vector of values which are recycled.

edge.width

Edge line width, corresponding to the 'lwd' parameter of the R 'par' function. See ?par for more details. It accepts a vector of values which are recycled.

edge.col

Color of the edges.

edge.alpha

Transparency of the edges.

edge.arrow.length

Length of the edges of the arrow head (in inches) - corresponding to the parameter of the R arrows function with the same name.

edge.arrow.angle

Angle from the shaft of the arrow to the edge of the arrow head - corresponding to the parameter of the R arrows function with the same name.

legend.x, legend.y

the x and y co-ordinates to be used to position the legend. They can be specified by keyword or in any way which is accepted by xy.coords.

legend.pch

the plotting symbols appearing in the legend, as numeric vector or a vector of 1-character strings

legend.cex

character expansion factor relative to current par("cex"). Used for text.

legend.inset

inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword.

com

The result of a community detection algorithm. When this parameter is set, a colored area is added behind each community.

com.cex

Increases (>1) or decreases (<1) the margin around the nodes when the colored areas are drawn around the communities.

show.layer.names

if TRUE adds the name of each layer at the center bottom of it.

layer.names.cex

Increases (>1) or decreases (<1) the size of the layer names.

...

Other graphical parameters.

values

A vector with values.

output

The type of graphical objects the values should be translated to. It can currently take values "color" and "shape".

Value

plot returns no value. values2graphics returns an object with fields: legend.text, legend.pch, legend.col and color or shape, containing respectively the text entries for the legend, their characher shapes, their colours, and the color or shape of the entities in the values input parameter.

See Also

multinet.layout, multinet.communities

Examples

net <- ml_florentine()
## Not run: 
plot(net)
c <- clique_percolation_ml(net)
plot(net, vertex.labels.cex=.5, com=c)

## End(Not run)
net <- ml_aucs()
## Not run: 
plot(net, vertex.labels=NA)
title("AUCS network")

## End(Not run)
values2graphics(c("a", "b", "b", "c"))

multinet documentation built on Feb. 16, 2023, 10:57 p.m.