Add a histogram figure to the chart.
fig_histogram( g, ..., bin_width = 5, sync = TRUE, data = NULL, inherit_asp = TRUE, alias = "count" )
g | An object of class |
---|---|
... | Options to pass to the figure, including |
bin_width | Width of bin. |
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
|
alias | Name of the range to display on tooltips, labels, etc. |
df <- data.frame( grp = rep(c("A", "B"), each = 200), val = c( rnorm(200, mean = 57, sd = 5), rnorm(200, mean = 53, sd = 5) ) ) g2(df, asp(val, color = grp)) %>% fig_histogram(adjust("stack"), bin_width = 1)