Description Usage Arguments Details Examples
Add a waffle figure to the chart.
1 2 3 4 5 6 7 8 9 10 11 12 |
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.
1 2 3 4 5 6 7 8 9 | 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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.