scale_category | R Documentation |
Creates a categorical scale. Categorical scales map input values defined in the set of
levels
to colours (or values). Input values not in the set of levels
are assigned
unmapped_color
(or unmapped_value
).
scale_color_category(
col,
palette = scales::brewer_pal("div"),
unmapped_color = "#000000",
levels = NULL,
unmapped_tick = NULL,
tick_format = NULL,
col_label = "{.col}",
legend = TRUE
)
scale_category(
col,
range = 0:1,
unmapped_value = 0,
levels = NULL,
col_label = "{.col}",
legend = TRUE
)
col |
< |
palette |
<
A |
unmapped_color |
< |
levels |
< If there are more levels than colours (or range values), the palette (or range) is interpolated. |
unmapped_tick |
< |
tick_format |
< |
col_label |
<
|
legend |
< |
range |
< |
unmapped_value |
< |
Other scales:
rescale_center()
,
rescale_diverge()
,
scale_identity()
,
scale_linear()
,
scale_log()
,
scale_power()
,
scale_quantile()
,
scale_quantize()
,
scale_symlog()
,
scale_threshold()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.