Learn R Programming

brainGraph (version 1.0.0)

plot_brainGraph_multi: Save PNG of three views of a brain graph

Description

This function will save a PNG file to disk containing three views (columns) of a brain graph (from left-to-right): left sagittal, axial, and right sagittal. The number of rows in the figure will equal the number of groups to plot.

Usage

plot_brainGraph_multi(g, groups = 1, N = 1, filename = "tmp.png",
  subgraph = NULL, main = NULL, ...)

Arguments

g
A list of lists of igraph graph objects
groups
An integer vector indicating which groups to plot; corresponds to the first element of the list g (default: 1)
N
An integer corresponding to the second element of the list g (default: 1)
filename
A character string of the filename of the PNG to be written (default: 'tmp.png')
subgraph
A list of character strings to (optionally) subset the graph(s), possibly by multiple conditions (default: NULL)
main
A list of character strings to be placed in the main title of the center plot for each group (default: NULL)
...
Other arguments passed to plot_brainGraph

Details

The function argument N tells the function to use the N-th element of the input list g for each group. So, for example, if g consists of lists of graphs for two groups, and N is 4, then the plots for g[[1]][[4]] and g[[2]][[4]] will be written to the file. The subgraph argument can be used to apply one or more conditions for subsetting the graph. If you would like multiple conditions, then it must be a list variable that equals in length to the number of groups. For a single group and multiple conditions, simply write e.g., groups=c(1, 1). The main argument has the same rule except it controls the main plot title, which appears in the axial view along with the Group name.

Examples

Run this code
## Not run: ------------------------------------
# plot_brainGraph_multi(g.hubs, groups=1:2, filename='Figure01_hubs.png',
#   subgraph='N > 0', vertex.color='color.lobe', vertex.size=15,
#   show.legend=TRUE, vertex.label.cex=1.5)
# plot_brainGraph_multi(g, groups=c(1, 1), N=5, filename='5_6core.png',
#   vertex.color='color.lobe', edge.color='color.lobe', vertex.label=NA,
#   subgraph=list('coreness > 5', 'coreness > 6'),
#   main=list('k-core 5', 'k-core 6'))
## ---------------------------------------------

Run the code above in your browser using DataLab