目次
第5回
# 密度関数のグラフ
normaldensity <- function(x) { return(dnorm(x, mean=0, sd=1)) }
# 濃淡のグラフ
a <- matrix(0, nrow=100, ncol=101)
for( i in c(1:100) ) {
for( j in c(1:101) ) {
x <- (j-51)/10
a[,j] <- dnorm(x,mean=0,sd=1)
}
}
x <- array(1:100)
y <- array(((0:100)-51)/10)
# 描画
par(mfrow=c(2,1))
plot(normaldensity, -2.5, 2.5)
image(y,x,-t(a), xlab="x", ylab=NA)
