r - ggplotly with dynamically adjusted number of bins -
i want know if number of bins can dynamically updated when using ggplotly.
here sample code:
library(ggplot2) library(plotly) x <- data.frame(a = 1:100, b = sample(rep(1:5,20))) test <- ggplot(x, aes(a, fill = as.factor(b))) + geom_histogram(bins = 20) ggplotly(test)
for instance, if zoom in 1:15, want split 15 bars instead of 3 (arbitrary number of bins here).
possible?
Comments
Post a Comment