Description Usage Arguments Details Value Author(s) Examples
Constructor methods for ColorMapping class
1 2 |
name |
name for this color mapping. The name is automatically generated if it is not specified. |
colors |
discrete colors. |
levels |
levels that correspond to |
col_fun |
color mapping function that maps continuous values to colors. |
breaks |
breaks for the continuous color mapping. If |
na_col |
colors for |
colors
and levels
are used for discrete color mapping, col_fun
and
breaks
are used for continuous color mapping.
A ColorMapping-class
object.
Zuguang Gu <z.gu@dkfz.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # discrete color mapping for characters
cm = ColorMapping(name = "test",
colors = c("blue", "white", "red"),
levels = c("a", "b", "c"))
cm
# discrete color mapping for numeric values
cm = ColorMapping(name = "test",
colors = c("blue", "white", "red"),
levels = c(1, 2, 3))
cm
# continuous color mapping
require(circlize)
cm = ColorMapping(name = "test",
col_fun = colorRamp2(c(0, 0.5, 1), c("blue", "white", "red")))
cm
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.