Skip to content
Prev 77895 / 398502 Next

hist(x, ...) with normal distribution curve

Knut Krueger wrote:
*There are a lot of answers to add a histogram.
Here is a simple way to add a tiny boxplot to a plot / histogram

x<-rexp(100)
hist(x)
boxplot(x,axes=F,add=T,horizontal=T,
     at=par()$usr[3]+diff(par()$usr[3:4])*.017,
     boxwex=0.02*diff(par()$usr[3:4]),pch=8)

Peter Wolf


*