# Best visualization for distributions at multiple time steps

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.

• 40 histograms with 10 bins each might well work. – Nick Cox Oct 7 '19 at 16:38
• Thanks for the reply Nick, agreed that a histogram is a great way to plot the distribution. However I feel as though 40 histograms in a single plot would be much to cluttered... in the end it may prove to be the best option but hoping to hear some alternative suggestions. – jmaths Oct 7 '19 at 17:29
• I don't have your data, but it seems that you haven't even tried this suggestion. – Nick Cox Oct 7 '19 at 17:40 