plot_brainGraph_multi: Save PNG of one or three views for all graphs in a...

View source: R/plot_brainGraph_multi.R

plot_brainGraph_multiR Documentation

Save PNG of one or three views for all graphs in a brainGraphList

Description

plot_brainGraph_multi writes a PNG file to disk containing three views (columns) of 1 or more brainGraph objects (from left-to-right): left sagittal, axial, and right sagittal. The number of rows in the figure will equal the number of graphs to plot.

slicer writes a PNG file to disk containing a single view (i.e., either sagittal, axial, or circular) of all brainGraph objects in the input list/brainGraphList.

Usage

plot_brainGraph_multi(g.list, filename = "orthoview.png",
  subgraph = NULL, main = NULL, label = NULL, cex.main = 1, ...)

slicer(g.list, nrows, ncols, plane = "axial", hemi = "both",
  filename = "all.png", main = NULL, cex.main = 1, ...)

Arguments

g.list

A brainGraphList or a list of brainGraph objects

filename

Character string of the filename of the PNG to be written.

subgraph

A vector or list of character strings to (optionally) subset the graph(s), possibly by multiple conditions

main

A vector or list of character strings to be placed in the main title of the center (axial) plot for each graph

label

A vector or list of character strings to be placed in one of the corners of the left plot (sagittal) in each row

cex.main

Numeric specifying the level of character expansion for the plot titles. Default: 1 (no expansion)

...

Other arguments passed to plot.brainGraph

nrows

Integer; the number of rows in the figure

ncols

Integer; the number of columns in the figure

plane

Character string indicating which orientation to plot. Default: 'axial'

hemi

Character string indicating which hemisphere to plot. Default: 'both'

Details

Whether the first input is a brainGraphList object or a list of brainGraph objects, all graphs in the object will be displayed in the figure. For plot_brainGraph_multi, this may be undesirable if you have more than 4 or 5 graphs in one object. You can choose fewer by using simple subsetting operations (see Examples below).

Using subgraphs, titles, and labels

There are three arguments that can differ for each graph to be displayed. Each follows the same “rules”. If you would like the same value applied to all graphs, you can specify a character string. If you would like a different value for each group, you must supply a vector or list with length equal to the number of graphs. If its length is less than the number of graphs, values will be recycled. To “skip” applying a value to one (or more) graph(s), you can use the NULL value only within a list (see the Examples below).

subgraph

Can be used to apply one or more conditions for subsetting the graph(s).

main

Controls the main plot title, which appears in the axial view along with each graph's name attribute. Depending on the level of the brainGraphList, this will either be a Study ID, Group name, or contrast name.

label

Can be used to print a text label in a corner for each group/graph. For example, you can print a letter if you will refer to, e.g., “Figure 1A”, “Figure 1B”, etc.

Note

All other arguments (passed to plot.brainGraph) will be applied to all graphs. For example, if you include vertex.label=NA in the function call, vertex labels will be omitted for all graphs.

Author(s)

Christopher G. Watson, cgwatson@bu.edu

See Also

Other Plotting functions: Plotting GLM graphs, plot.brainGraphList, plot.brainGraph

Examples

## Not run: 
## "g.hubs" contains 2 groups; apply same subset to both
plot_brainGraph_multi(g.hubs, filename='Figure01_hubs.png',
  subgraph='N > 0', vertex.color='color.lobe', vertex.size=15,
  show.legend=TRUE, vertex.label.cex=1.5)

## Single group, different subgraphs for both plots
## "g" is a "brainGraphList" object
gg <- g[rep(1, 3), drop=FALSE]
plot_brainGraph_multi(gg, filename='group1_5-6-7core.png',
  vertex.color='color.lobe', edge.color='color.lobe', vertex.label=NA,
  subgraph=as.list(paste('coreness >', 5:7)),
  main=as.list(paste('k-core', 5:7)))

## Apply different subset for groups 1 & 3; no subset for group 2
plot_brainGraph_multi(g, groups=1:3, vertex.label=NA,
  subgraph=list('degree > 5', NULL, 'degree > 4'))

## End(Not run)

brainGraph documentation built on June 22, 2024, 7:36 p.m.