I've created a plot with xyplot
, which must show two groups of dots and they're regression line.
xyplot(log(Vegetati)~log(Reprod),
type=c("p", "r"),
group=Espece,
data=plantes,
panel = "panel.superpose",
auto.key =list(
points = FALSE,
columns=2),
xlab="log(modules végétatifs)",
ylab="log(modules reproducteurs)",
)
I would now add the equations of the two different regression lines, but I don't succeed at combine the panel.superpose
function with a panel.text or other.
Am I in the wrong way? I can't show the equation AND the two dot's groups with they're line.
Thanks! So, this is a reproductible exemple :
library(lattice)
data(iris)
xyplot(log(Sepal.Width)~log(Sepal.Length), type=c("p", "r"), group=Species,
data=iris, panel = "panel.superpose")
EDIT : Problem solved! Thank you!