Add a waffle figure to the chart.
fig_waffle( g, ..., n = 500, rows = 10, size = c(1, 1), gap = 0.1, min_size = 15, sync = TRUE, data = NULL, inherit_asp = TRUE )
g | An object of class |
---|---|
... | Options to pass to the figure, including |
n | Number of squares to use. |
rows | Number of rows. |
size | Size of squares. |
gap | Gap between squares. |
min_size | Minimum size of squares. |
sync | Whether to sync the axis data (align) with that
used in other figures, set to |
data | A dataset ( |
inherit_asp | Whether to inherit the aspects paseed to
|
Requires the x
and color
aspects.
fruits <- data.frame( fruit = c("Apples", "Bananas", "Pears", "Oranges"), value = c(.45, .15, .35, .05) * 100 ) g2(fruits, asp(value, color = fruit)) %>% fig_waffle() %>% motif(padding = 50) %>% axis_hide()