下面给出绘制这张图形的R语言源代码:大家有兴趣可以自己绘制一下,也可以调整一下效果看看
aa1 <-curve(dnorm(x, 7, 1), from = 0, to = 20,xlim=c(0,20),ylim=c(0,1.0),col="blue",lwd=2,lty=1) aa2 <-curve(dnorm(x, 8, 1), from = 0, to = 20,add=T,col="blue",lwd=2,lty=2) aa3 <-curve(dnorm(x, 9, 1), from = 0, to = 20,add=T,col="blue",lwd=2,lty=3) aa4 <-curve(dnorm(x, 12, 1), from = 0, to = 20,add=T,col="blue",lwd=2,lty=4) aa5 <-curve(dnorm(x, 14, 1), from = 01, to = 20,add=T,col="blue",lwd=2,lty=5) axis(side=1,at=c(1:20)) y = aa1$y +aa2$y+aa3$y+aa4$y+aa5$y y2 = y /5 lines(aa1$x,y,lwd=3,lty=1,col="red") lines(aa1$x,y2,lwd=3,lty=1,col="green") legend("topright", legend = c("N(7,1)","N(8,1)","N(9,1)","N(12,1)","N(14,1)","sum","Normal"), col=c("blue","blue","blue","blue","blue","red","green"), lwd=c(2,2,2,2,2,3,3), lty=c(1,2,3,4,5,1,1)) |