Skip to content
Prev 1837 / 7420 Next

Superimpose 2 variables in lattice plots, with different scales

I am trying to use xyplot() in lattice to create a line plot of two 
different variables that have different scales, to see how varying the 
level of a stressor affects number of species:

y1: Number of animal species
y2: Number of plant species
x: Stressor level
z: Study area

y1 and y2 have different spatial scales, so using the formula y1+y2~x|z 
results in a plot that is only useful for examining the larger variable.

Ideally, I would have the axis label for y1 on the left side, and the 
axis label for y2 on the right side, and you can examine the response of 
both variables against increasing stressor level.

Any suggestions?

Thanks!!!