R/jamenrich-plot.R
grid_with_title.Rd
Draw Heatmap with title and subtitle using grid viewports
grid_with_title(
object,
title = NULL,
title_fontsize = 18,
title_just = "centre",
caption = NULL,
caption_fontsize = 12,
caption_just = "left",
caption_x = NULL,
verbose = FALSE,
...
)
an object with class "Heatmap"
, "gTree"
, or
any object where methods::hasMethod("draw", class(object))
is TRUE
.
character string used as title. When NULL
or
nchar(title)==0
then no title is displayed.
numeric value indicating the font size,
with units "points"
.
character string indicating the justification (alignment) of the title.
arguments equivalent to the title_* arguments.
numeric value in grid units specifying where to
position the caption text. By default when caption_just
is "left"
the caption_x
is defined by grid::unit(0.2, "npc")
, which
positions the caption at the left side (20% from the left edge)
of the plot, with text proceeding to the right of that point.
logical indicating whether to print verbose output.
additional arguments are ignored.
The byproduct of this function is to draw a grid visualization
that includes a title and subtitle, then the object
in the center.
This function is likely to work only with grid
or ComplexHeatmap
input. Other objects that have draw()
defined may not work
properly.
This function is intended to help make it easier to wrap a
heatmap from ComplexHeatmap::Heatmap()
inside the relevant
grid viewports in order to display one large title at the
top of the resulting visualization, and optionally one
subtitle at the bottom of the visualization.
The input can be one heatmap (Heatmap
object),
or object of class "gTree"
, or any object with a method
draw()
associated with it, detected by
methods::hasMethod("draw", class(object))
.
A good example of "gTree"
object is the result of
calling draw()
inside grid::grid.grabExpr()
, for example:
grid::grid.grabExpr(ComplexHeatmap::draw(...))
The ComplexHeatmap::draw()
function has extended capability
for arranging one or more heatmaps and associated annotations.
Other jam plot functions:
adjust_polygon_border()
,
jam_igraph()
,
mem_enrichment_heatmap()
,
mem_gene_path_heatmap()
,
mem_legend()
,
mem_multienrichplot()
,
mem_plot_folio()
,
plot_layout_scale()