[R-sig-eco] Superimpose 2 variables in lattice plots, with different scales

Raphael Mazor raphaelm at sccwrp.org
Wed Jan 19 06:30:38 CET 2011


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!!!

-- 
Raphael D. Mazor
Freshwater Biologist
Southern California Coastal Water Research Project
3535 Harbor Blv Suite 110
Costa Mesa, CA 92626

Tel. (714) 755-3235
Fax. (714) 755-3299



More information about the R-sig-ecology mailing list