data(BJDAT)
attach(BJDAT)
x <- as.numeric( tapply(DOY, DOY, mean) )
y <- as.numeric( tapply(MDT, DOY, mean) )
y.sd <- as.numeric( tapply(MDT, DOY, sd) )
dev.new()
par1 <- par(family="serif")
par2 <- par(mar=c(5, 5, 2, 2))
par3 <- par(mgp=c(3, 1, 0))
plot( x, y, cex = 1.5, xlim = c(0, 367), ylim = c(-10, 30),
cex.lab = 1.5, cex.axis = 1.5, type = "n", xlab = "Day-of-year",
ylab = expression(paste("Mean daily temperature (", degree, "C)", sep="")) )
for(i in 1:length(x)){
lines(c(x[i], x[i]), c(y[i]-y.sd[i], y[i]+y.sd[i]), col=4)
}
points(x, y, cex = 1.5)
par(par1)
par(par2)
par(par3)
# graphics.off()
Run the code above in your browser using DataLab