ggheatmap
is an alias of heatmap_layout
.
Usage
heatmap_layout(
data,
mapping = aes(),
...,
.width = NA,
.height = NA,
action = NULL,
theme = NULL,
filling = TRUE,
set_context = TRUE,
order = NULL,
name = NULL,
guides = deprecated()
)
ggheatmap(
data,
mapping = aes(),
...,
.width = NA,
.height = NA,
action = NULL,
theme = NULL,
filling = TRUE,
set_context = TRUE,
order = NULL,
name = NULL,
guides = deprecated()
)
Arguments
- data
A numeric or character vector, a data frame, and any other data which can be converted into a matrix. Simple vector will be converted into a one column matrix.
- mapping
Default list of aesthetic mappings to use for plot. In addition, we will always add mapping
aes(.data$.x, .data$.y)
.- ...
Additional arguments passed to geom_tile()/geom_raster(). Only used when
filling = TRUE
.- .width, .height
Heatmap body width/height, can be a unit object.
- action
A
plot_action()
object used to define the default plot action in the layout.- theme
A
theme()
used to render theguides
,title
,subtitle
,caption
,margins
,patch.title
,panel.border
, andbackground
. IfNULL
(default), will inherit from the parentlayout
.- filling
A boolean value indicating whether to fill the heatmap. If you wish to customize the filling style, set this to
FALSE
.By default, the classic heatmap colour scheme
scale_fill_gradient2(low = "blue", high = "red")
is utilized for continuous values. You can use the option"ggalign.heatmap_continuous_fill"
or"ggalign.heatmap_discrete_fill"
to modify the default heatmap body fill color scale. Seescale_fill_continuous()
orscale_fill_discrete()
for option setting details.- set_context
A single boolean value indicates whether to set the active context to current plot. If
TRUE
, all subsequent ggplot elements will be added into this plot.- order
An single integer for the plot area order.
- name
A string of the plot name. Used to switch the active context in
hmanno()
orstack_active()
.- guides
A string with one or more of
"t"
,"l"
,"b"
, and"r"
indicating which side of guide legends should be collected. Defaults towaiver()
, which inherits from the parent layout. If there is no parent layout, or ifNULL
is provided, no guides will be collected.
ggplot2 specification
The data input in ggheatmap
will be converted into the long formated data
frame when drawing. The default mapping will use aes(.data$.x, .data$.y)
,
you can use mapping
argument to control it. The data in the underlying
ggplot
object contains following columns:
.xpanel
and.ypanel
: the column and row panel.x
and.y
: thex
andy
coordinates.row_names
and.column_names
: A factor of the row and column names of the original matrix (only applicable when names exist)..row_index
and.column_index
: the row and column index of the original matrix.value
: the actual matrix value.