par(mfrow=c(2,2))
f1 <- function(a){
opar=par("mar","xaxt","yaxt","plt")
on.exit(par(opar))
par(mar=rep(.1,4),xaxt="n",yaxt="n",plt=par("plt"))
hist(a,xlab="",ylab="",main="",col="white",proba=TRUE)
lines(seq(-4,4,le=50),dnorm(seq(-4,4,le=50)),col="red")
}
a <- rnorm(100)
barplot(sort(a))
add.scatter(f1(a),posi="topleft",bg.col="grey")
a <- rnorm(100)
barplot(sort(a))
add.scatter(f1(a),posi="topleft",bg.col="grey",inset=c(.25,.01))
a <- rnorm(100)
barplot(sort(a))
add.scatter(f1(a),posi="topleft",bg.col="grey",inset=.25,ratio=.1)
a <- rnorm(100)
barplot(sort(a))
add.scatter(f1(a),posi="bottomright",bg.col="grey",ratio=.3)
par(mfrow=c(1,1))
data(microsatt)
w <- dudi.coa(data.frame(t(microsatt$tab)), scann = FALSE,nf=3)
s.label(w$co)
add.scatter.eig(w$eig,w$nf,posi="bottomright",1,2)
Run the code above in your browser using DataLab