「日本晴」収量の年次効果と施肥水準によるプロット
x <- tapply(rice.dfr$gy, fert:year, mean)
plot(1:4, x[1:4], type="b", lwd=2, cex=1.5, xaxt="n", xlab="year", ylab="yield",
      
ylim=c(300,600), pch=0, lty=1,cex.lab=1.2, cex.axis=1.2, col="red")
axis(1, 1:4, labels=levels(year), cex.axis=1.2)
box(lwd=3)
par(new=T)
plot(1:4, x[5:8], type="b",lwd=2, cex=1.5,
      
axes=F, xlab="", ylab="" , ylim=c(300,600), pch=2,lty=1, col="blue")
par(new=T)
plot(1:4, x[9:12], type="b", lwd=2, cex=1.5, axes=F, xlab="", ylab="" ,
      
ylim=c(300,600), pch=3,lty=1, col="green")
legend(locator(1), legend=c("fert1","fert2","fert3"), pch=c(0,2,3),
      
col=c("red","blue","green"), cex=1.2)