I have a set of discrete observations at multiple time points (~40) all of which are at similar scales i.e., between 0 and 10, and have been trying to determine the best visualization to show the individual distributions in one plot, ideally without just plotting summary statistics via box-plots or something similar (although this may very well turn out to be the best option in the end). Is there any suggestions of plots suited to such visualizations, ideally in ggplot?
Other options I've thought of is a line-chart for the mean along with 95% percentiles at each time point and appears to be the best option at the moment. Below is some simulated data (the real dataset is much larger, and more varied in distribution).
df = data.frame(points = c(), time = c())
for (i in 1:40){
temp <- as.data.frame(cbind(sqrt(i)*sample(1:10, 10000, replace=T), rep(i,10000)))
names(temp) <- c('points','time')
df <- rbind(df, temp)
}
ggplot(df %>%
group_by(time) %>%
summarise(`025%`=quantile(points, probs=0.025),
`0975%`=quantile(points, probs=0.975),
avg=mean(points)), aes(x = time, y = avg)) +
geom_ribbon(aes(ymax = `0975%`, ymin = `025%`), fill = 'red',
alpha = 0.1, show.legend = FALSE) +
geom_line(size = 1, col = 'red') +
geom_point()
Any comments would be greatly appreciated.