xmin <- 0
xmax <- 5; title <- c("n=5")
#xmax <- 25; title <- c("n=25")
pvalue=0.5
datab<-dbinom(0:xmax, xmax, pvalue)
datan<-dnorm(0:xmax,mean=xmax/2,sd=sqrt(xmax)/2)
difdata<-datan-datab

datax <- matrix(c(datab,datan,difdata),nrow=xmax+1,ncol=3)
datay <- t(datax)
rownames(datay) <- c("binorm,","norm.","diff.")
colnames(datay)<-0:xmax
barplot(datay,beside = TRUE,legend=rownames(datay),
        main=title,xlab="Number of samples",ylab="Probability")