color_mapping_legend-ColorMapping-method | R Documentation |
Draw Legend Based on Color Mapping
## S4 method for signature 'ColorMapping'
color_mapping_legend(object,
plot = TRUE, ...,
color_bar = object@type,
title = object@name,
title_gp = gpar(fontsize = 10, fontface = "bold"),
title_position = "topleft",
grid_height = unit(4, "mm"),
grid_width = unit(4, "mm"),
tick_length = unit(0.8, "mm"),
border = NULL,
at = object@levels,
labels = at,
labels_gp = gpar(fontsize = 10),
labels_rot = 0,
nrow = NULL,
ncol = 1,
by_row = FALSE,
legend_gp = gpar(),
legend_height = NULL,
legend_width = NULL,
legend_direction = c("vertical", "horizontal"),
break_dist = NULL,
graphics = NULL,
param = NULL)
object |
A |
plot |
Whether to plot or just return the legend object? |
... |
Pass to |
color_bar |
"continous" or "discrete". It controls whether to show the discrete legend for the continuous color mapping. |
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. See |
grid_height |
Height of each legend grid. Pass to |
grid_width |
Width of each legend grid. Pass to |
tick_length |
Length of the ticks on the continuous legends. Value should be a |
border |
Color for legend grid borders. Pass to |
at |
Break values of the legend. By default it is the levels in the |
labels |
Labels corresponding to break values. |
labels_gp |
Graphcial parameters for legend labels. |
labels_rot |
Rotation of labels. |
nrow |
Pass to |
ncol |
Pass to |
by_row |
Pass to |
legend_gp |
Graphic parameters for legend. |
legend_height |
Height of the legend body. It only works when |
legend_width |
Width of the legend body. It only works when |
legend_direction |
When |
break_dist |
A zooming factor to control relative distance of two neighbouring break values.The length of it should be |
graphics |
Internally used. |
param |
All the legend-related parameters can be specified as a single list. |
The legend is constructed by Legend
.
A Legends-class
object.
Zuguang Gu <z.gu@dkfz.de>
# There is no example
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.