theta <- seq(0,1,.01)
dens <- theta^3*(1-theta)^13 + 10*theta^4*(1-theta)^12 +
 45*theta^5*(1-theta)^11
#Normalize
dens = dens/sum(dens*0.01)
dens2 = dbeta(theta,4,4)
par(mfrow=c(1,1))
matplot (cbind(theta,theta),cbind(dens2,dens), 
      type="l", xlab="theta", ylab="", xaxs="i",lwd=2,
      yaxs="i", yaxt="n", bty="n", cex=2,col=1:2,lty=1)
legend("topright",c("Prior","Posterior"),lwd=2,col=1:2,lty=1)
