手工绘制
par(mfrow=c(1,2))
plot(seq(-3,3,0.01), dnorm(seq(-3,3,0.01)),
xlab = 'x', ylab = 'f(x)',
ylim = c(0,0.5),
xaxs = 'i', yaxs = 'i', type = 'l')
plot(qnorm(seq(0,1,0.001)), seq(0,1,0.001),
xlab = 'x', ylab = 'F(x)',
xaxs = 'i', yaxs = 'i', type = 'l')
x = seq(-3,3,0.01)
par(mfrow=c(1,1))
plot(x,x, main = 'Q-Q figure',
xlim = c(-3,3), ylim = c(-3,3),
xlab = 'Theoretical quantile', ylab = 'Sample quantile',
xaxs = 'i', yaxs = 'i',
type = 'l')
n = 200
x = seq(-3,3,0.01)
par(mfrow=c(1,1))
plot(x,x,
xlim = c(-3,3), ylim = c(-3,3),
xaxs = 'i', yaxs = 'i',
yaxt = 'n',
ann = F, type = 'l')
axis(2, las = 1)
title(main = paste0('Normal n = ',n),
xlab= 'Normal quantile', ylab = 'EL quantile',
line = 2)