#postscript('../WriteUp/Graphics/1984/prob_24_AHSME.eps', onefile=FALSE, horizontal=FALSE) as = seq(0, 6, length.out=200) b1 = as^2 / 8 b2 = sqrt(as) plot(as, b1, type='l', col='blue', ylim=c(min(b1, b2), max(b1, b2)), xlab='a', ylab='b(a)') lines(as, b2, type='l', col='red') mask = b1>b2 polygon(c(as[mask], rev(as[mask])), c(b1[mask], rev(b2[mask])), col=gray(0.8)) grid() legend(0, 4.5, legend=c('a^2/8', 'sqrt(a)'), col=c('blue', 'red'), lty=c(1, 1)) #dev.off()