I've realized plots with lattice and I need to split my data to get a representation of different stations of a lake, with the line and the dots for each replicas made by each team have worked in this lake. I manage to do that, but the legend is formed by all of the team have worked in this exercise and present in my DB, not only by the ones which appear in my plot.
# Expression des données physico
###############################################
#Expression des données pour Cromwell
#Préparation du panel
panel.my <- function(...) {
panel.superpose(...)
}
trellis.par.set(superpose.symbol=list(pch=c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)),
superpose.line=list(lty=c(1, 2, 3, 4, 5, 6, 7)))
#Graphique Temp avec lines
xyplot(prof~temp | lake * station,
type=c("p", "l"),
physico,
subset=lake=="Crom",
group=team,
panel = panel.my,
xlim=c(6,15),
ylim=c(10,-1),
scales=list(x= list(at=seq(5, 15, 1)), y = list(at=seq(0, 10, 1))),
auto.key =list(
draw.key=list(text=list("Equipe 1", "Equipe 1'")),
points = TRUE,
columns=2),
xlab="Température",
ylab="Profondeur",
)
The result : http://environnementaliste.files.wordpress.com/2013/11/cromwell_temp.jpeg
Somebody have any idea to limit my legend at the relevant information?
Thanks!
Lucas