View source: R/plot_brainGraph_multi.R
plot_brainGraph_multi | R Documentation |
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
.
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, ...)
g.list |
A |
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: |
... |
Other arguments passed to |
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: |
hemi |
Character string indicating which hemisphere to plot. Default:
|
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).
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).
Can be used to apply one or more conditions for subsetting the graph(s).
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.
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.
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.
Christopher G. Watson, cgwatson@bu.edu
Other Plotting functions: Plotting GLM graphs
,
plot.brainGraphList
,
plot.brainGraph
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.