Adding legend to lattice xyplot

Viewed 14

I am trying to add a legend to the right hand side of this xyplot using the simpleKey function but can't seem to get the syntax correct. I am trying to make a legend to differentiate between males and females on both of these plots.

This is my code for the plot: enter image description here

and this is the resulting plot

enter image description here

so the brown ("peru") points are females and the blue ("cornflowerblue") are males.

I hope I have given enough detail - thanks!

0 Answers
Related