Usage
## S3 method for class 'ColorMapping':
color_mapping_legend(object, ...,
plot = TRUE,
title = object@name,
title_gp = gpar(fontsize = 10, fontface = "bold"),
title_position = c("topleft", "topcenter", "leftcenter", "lefttop"),
color_bar = c("discrete", "continuous"),
grid_height = unit(4, "mm"),
grid_width = unit(4, "mm"),
grid_border = NULL,
at = object@levels,
labels = at,
labels_gp = gpar(fontsize = 10),
nrow = NULL,
ncol = 1,
legend_height = NULL, legend_width = NULL,
legend_direction = c("vertical", "horizontal"),
param = NULL)
Arguments
plot
whether to plot or just return the size of the legend viewport.
title
title of the legend, by default it is the name of the legend
title_gp
graphical parameters for legend title
title_position
position of the title
color_bar
if the mapping is continuous, whether show the legend as discrete color bar or continuous color bar
grid_height
height of each legend grid.
grid_width
width of each legend grid.
grid_border
color for legend grid borders.
at
break values of the legend
labels
labels corresponding to break values
labels_gp
graphcial parameters for legend labels
nrow
if there are too many legend grids, they can be put as an array, this controls number of rows
ncol
if there are too many legend grids, they can be put as an array, this controls number of columns
legend_height
height of the legend, only works when color_bar
is continuous
and direction
is vertical
legend_width
width of the legend, only works when color_bar
is continuous
and direction
is horizontal
legend_direction
when color_bar
is continuous
, should the legend be vertical or horizontal?
param
will be parsed if the parameters are specified as a list