rbokeh
rbokeh copied to clipboard
feature request: grouped histgram / density plot
Currently, there is no easy way to plot grouped histgram / density plot. Adding group kw to ly_hist and ly_density?
Currently, I do:
# to use mpg data
library(ggplot2)
colors <- scales::hue_pal()(length(levels(mpg$class)))
colors <- setNames(colors, levels(mpg$class))
colors
ghist <- function(fig, group) {
ly_hist(fig, x = hwy, data = dplyr::filter(mpg, class == group),
breaks = seq(10, 45, 5), color = colors[[group]])
}
Reduce(ghist, levels(mpg$class), figure())

This should be a simple addition - will put it in soon.