
Kodom fill scale for the fill aesthetic
scale_fill_kodom.RdIdentical behavior to scale_color_kodom() but targets the fill
aesthetic. Intended for use with geom_kodom_heatmap().
Usage
scale_fill_kodom(
colors = kodom_colors(),
color_breaks = NULL,
name = ggplot2::waiver(),
discretize = FALSE,
...
)Arguments
- colors
Color vector. Defaults to
kodom_colors().- color_breaks
Numeric breakpoints anchoring the gradient via
scales::rescale(). Fordiscretize = TRUE, each break adds one band:kbreaks producek + 1bands.NULL= evenly spaced.- name
Legend title. Defaults to
"value".- discretize
FALSE(default) = smooth gradient;TRUE= step bands atcolor_breaks.- ...
Ignored.
Examples
# \donttest{
library(ggplot2)
df <- data.frame(
subject_id = rep(1:5, each = 4),
time = rep(1:4, 5),
visit_month = rep(1:4, 5),
value = rep(1:4, 5),
hba1c = rep(1:4, 5),
arm = rep(c("Treatment", "Control"), c(12, 8))
)
ggplot(df, aes(x = time, id = subject_id, fill = value)) +
geom_kodom_heatmap() +
scale_fill_kodom()
# }