Skip to contents

Creates an icicle plot where different depth levels can use different fill colour mappings. Uses ggnewscale::new_scale_fill() to enable multiple fill scales in a single plot.

Usage

icicle_multifill(sb, fills, colour = "white", linewidth = 0.2, ...)

Arguments

sb

A sunburst_data object from sunburst_data().

fills

A named list mapping depth levels (as character strings) to column names in sb$rects for fill mapping. E.g., list("1" = "name", "2" = "value").

colour

Border colour for rectangles. Default "white".

linewidth

Border line width. Default 0.2.

...

Passed to ggplot2::geom_rect().

Value

A ggplot object with scale_y_reverse() and theme_void().

See also

sunburst_multifill() for the polar variant, icicle() for single-scale fill.

Examples

sb <- sunburst_data("((a, b, c), (d, e));")
if (requireNamespace("ggnewscale", quietly = TRUE)) {
  icicle_multifill(sb, fills = list("1" = "name", "2" = "name"))
}