curve(erf, -3, 3, col="red", ylab="", las=1)
curve(pnorm, -3, 3, add=TRUE, col="blue", lty="dotted", lwd=2)
abline(v=0, h=0, lty="dashed")
legend("topleft", c("erf(x)", "pnorm(x)"), col=c("red", "blue"),
lty=c("solid", "dotted"), lwd=1:2)
Run the code above in your browser using DataLab