Add text to lattice plot?
问题 Could someone tell me how to add a text line to lattice plot. My code is: xyplot(Neff~Eeff,data=phuong,panel=mypanel, col="black", pch=18,xlab="Energy efficiency (%)", ylab = "Nitrogen efficiency (%)", main="(a)") Here pane=mypanel is to add an abline. I want to add a linear regression equation between Eeff and Neff to their plot. Thanks! 回答1: So, with reproducible data: set.seed(1) phuong <- data.frame(Eeff = rnorm(100,31)) phuong$Neff <- rnorm(100,19.7 + .36*phuong$Eeff) # Create the lm