N1<-8
N2<-8
m1<-50
m2<-50
v1<-5
v2<-5
d1<-rnorm(N1,m1,sqrt(v1))
d2<-rnorm(N2,m2,sqrt(v2))
mdeltas<-seq(from=-5,to=5,by=0.5)
par(ask=TRUE)
d1<-rnorm(N1,m1,sqrt(v1))
d2<-rnorm(N2,m2,sqrt(v2))
ylim<-range(c(d1,d2+min(mdeltas),d2+max(mdeltas)))
for(i in 1:length(mdeltas)){
tmpd2<-d2+mdeltas[i]
t.test.out<-t.test(d1,tmpd2)
plot(c(rep(1,N1),rep(2,N2)),c(d1,tmpd2),pch=19,cex=0.5,xlim=c(0,3),ylim=ylim,main=t.test.out$p.value,xlab="",ylab="")
boxplot(d1,tmpd2,main=t.test.out$p.value,ylim=ylim,xlab="",ylab="")
}