theta.grid <- seq( 0.01, 0.99, length = 500 ) # pdf( "beta-densities-1.pdf" ) plot( theta.grid, dbeta( theta.grid, 0.5, 0.5 ), xlab = 'theta', ylab = 'Density', ylim = c( 0, 6 ), type = 'l' ) lines( theta.grid, dbeta( theta.grid, 1, 1 ), lty = 2 ) lines( theta.grid, dbeta( theta.grid, 2, 3 ), lty = 3 ) lines( theta.grid, dbeta( theta.grid, 30, 20 ), lty = 4 ) text( 0.075, 3, "( 0.5, 0.5 )" ) text( 0.3, 2, "( 2, 3 )" ) text( 0.7, 5, "( 30, 20 )" ) text( 0.8, 1.25, "( 1, 1 )" ) # dev.off( )