plot.brainGraph
plots a graph in which the spatial layout of the nodes
is important. The network itself is plotted over a brain MRI slice from the
MNI152 template by default (when mni=TRUE
).
# S3 method for brainGraph
plot(x, plane = c("axial", "sagittal", "circular"),
hemi = c("both", "L", "R"), mni = TRUE, subgraph = NULL,
main = NULL, subtitle = "default", label = NULL, side = 1,
line = -2, adj = 0.025, cex = 2.5, col = "white", font = 2,
show.legend = FALSE, rescale = FALSE, asp = 0, ...)
A brainGraph
graph object
Character string indicating which orientation to plot.
Default: 'axial'
Character string indicating which hemisphere to plot. Default:
'both'
Logical indicating whether or not to plot over a slice of the
brain. Default: TRUE
Character string specifying a logical condition for vertices
to plot. Default: NULL
Character string; the main title. Default: NULL
Character string; the subtitle. Default: 'default'
Character string specifying text to display in one corner of the
plot (e.g., 'A.'
). Default: NULL
Label placement. Default: 1
(bottom)
Which margin line to place the text.
If side=1
, a value closer to 0 places the text closer to
the left margin. Default: 0.025
Amount of character expansion of the label text. Default:
2.5
Label font color. Default: 'white'
Integer specifying the font type. Default: 2
(bold face)
Logical indicating whether or not to show a legend.
Default: FALSE
Logical, whether to rescale the coordinates. Default:
FALSE
Numeric constant; the aspect ratio. Default: 0
Other parameters (passed to plot.igraph
).
See plot.common
for details.
With the argument subgraph
, you can supply a simple logical expression
specifying which vertices to show. For example, 'degree > 10' will
plot only vertices with a degree greater than 10. Combinations of
AND (i.e., &
) and OR (i.e., |
) are allowed. This
requires that any vertex attribute in the expression must be present in the
graph; e.g., V(g)$degree
must exist.
By default, a title (i.e., text displayed at the top of the figure) is
not included. You can include one by passing a character string to
main
, and control the size with cex.main
. A subtitle
(i.e., text at the bottom), is included by default and displays the number of
vertices and edges along with the graph density. To exclude this, specify
subtitle=NULL
. A “label” can be included in one corner of the
figure (for publications). For example, you can choose label='A.'
or
label='a)'
. Arguments controlling the location and appearance can be
changed, but the default values are optimal for bottom-left placement. See
mtext
for more details. The label-specific arguments
are:
The location. 1
is for bottom placement.
If side=1
(bottom), a negative number places the text
above the bottom of the figure; a higher number could result in
the bottom part of the text to be missing. This can differ if
plane='circular'
, in which case you may want to specify a positive
number.
Seems to be the percentage away from the margin. So, for
example, adj=0.1
would place the text closer to the center than
the default value, and adj=0.5
places it in the center.
The degree of “character expansion”. A value of 1 would not increase the text size.
The text color.
The font type. The default font=2
is bold face. See
par
for details.
Christopher G. Watson, cgwatson@bu.edu
Other Plotting functions: Plotting GLM graphs
,
plot.brainGraphList
,
plot_brainGraph_multi
if (FALSE) {
plot(g[[1]], hemi='R')
plot(g[[1]], subgraph='degree > 10 | btwn.cent > 50')
## Place label in upper-left
plot(g.ex, label='A)', side=3, line=-2.5)
}
Run the code above in your browser using DataLab