[R] Hmisc xYplot: two ablines?
Michael Kubovy
kubovy at virginia.edu
Tue Jan 10 20:17:28 CET 2006
To r-help:
Thanks to Mat Soukup for the help:
To draw two ablines:
xYplot(lo ~ vaR, groups = v, data = abc.fp, aspect = "xy", col = c
("red","blue"),
xlab=expression(frac(abs( bold(v) ),abs( bold(a) ))),
ylab = grid::textGrob(expression(paste(log, frac( italic(p) ( italic
(v) ), italic(p) ( italic(a) )))) ),
panel=function(x,y,...){
panel.xYplot(x, y, ...)
panel.abline(a = 7.985090, b= -7.985090, col = "red")
panel.abline(a = 7.926507, b = -7.926507, col = "blue", lty = 2)
}
)
This is (to me) a surprising syntactic leap from one abline in
xYplot, which can be requested without writing a panel function:
xYplot(lo ~ vaR, groups = v, data = abc.fp, aspect = "xy", col = c
("red","blue"),
xlab=expression(frac(abs( bold(v) ),abs( bold(a) ))),
ylab = grid::textGrob(expression(paste(log, frac( italic(p) ( italic
(v) ), italic(p) ( italic(a) )))) ),
panel.abline(a = 7.985090, b= -7.985090, col = "red")
)
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road Charlottesville, VA 22903
Office: B011 +1-434-982-4729
Lab: B019 +1-434-982-4751
Fax: +1-434-982-4766
WWW: http://www.people.virginia.edu/~mk9y/
More information about the R-help
mailing list