nsample<-20; nbingo<-10; trial<-5
ndata<-c(0:trial)
dhdata<-vector(mode="numeric"); phdata<-vector(mode="numeric")
for(i in 0:trial){ 
  dhdata[i+1]<-dhyper(i,nbingo,nsample-nbingo,trial,log=FALSE)
  phdata[i+1]<-phyper(i,nbingo,nsample-nbingo,trial,log=FALSE)
}
#--------------------
xrange<-c(0,trial); yrange<-c(0,1)
vdh<-sprintf("%.5f",dhdata); vph<-sprintf("%.5f",phdata)
plot(ndata,phdata,xlim=xrange,ylim=yrange,ylab="",col="blue")
text(ndata,phdata,labels=vph,pos=3,offset=0.1,col="blue",cex=0.7)
points(ndata,dhdata,col="red",pch=16)
text(ndata,dhdata,labels=vdh,pos=1,offset=0.1,col="red",cex=0.7)
