Create a single image which displays multiple image files. Tailored to support
composite layouts of plots from view_xifti
.
view_comp(
img,
ncol = NULL,
nrow = NULL,
legend = NULL,
title = NULL,
legend_height = 0.3,
title_height = 0.1,
title_fsize = 5,
newpage = is.null(fname),
fname = NULL,
...
)
The composite plot
Character vector of paths to images to include. They will be arranged by row.
Control the layout of the composite image. NULL
(default)
will use approximately same numbers of rows and columns.
File path to a legend image to add, or NULL
(default)
to not add a legend.
A length-one character vector to use as the title, or NULL
(default) to not add a title.
Heights of the legend and title, if
applicable. Specified relative to all the plots, so .1
would
mean the height is a tenth of the height of all the plots. Default:
.1
for the title and .3
for the legend.
Multiplier for font size. Default: 5
Call grid::grid.newpage
before rendering?
Default: is.null(fname)
.
If NULL
(default), print the result. Otherwise, save to
a PNG file at this location. Will override newpage
to FALSE
.
Additional arguments to gridExtra::arrangeGrob
. The
arguments grobs
and layout_matrix
should be avoided because
they are determined based on img
. adjusting widths
may be useful,
e.g. to make the subcortex subplot be less wide than the cortex subplot.
Requires the following packages: png
, grid
, gridExtra
How it works: the non-legend images (plots) are composited in a call to
grid::arrangeGrob
. If a title or legend exists, it's added to the top and
bottom, respectively, of the plots after with another call to grid::arangeGrob
.
Other visualizing:
view_surf()
,
view_xifti()
,
view_xifti_surface()
,
view_xifti_volume()