[R] hist(x, ...) with normal distribution curve

Peter Wolf pwolf at wiwi.uni-bielefeld.de
Tue Sep 27 10:32:20 CEST 2005


Knut Krueger wrote:
>.
>I am looking for a histogram or box plot with the adding  normal 
>distribution  curve
>I think that must be possible, but I am not able to find out how to do.
>
>
>
>Regards Knut
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>  
*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


*




More information about the R-help mailing list