ken knoblauch
2006-May-18 07:03 UTC
[R] adding grid lines to an xyplot when there is only 1 panel - corrected
Sorry, some things got garbled in that request for help that might make my request unintelligible, probably it being too late at night when I posted, here is the corrected function call for which I would like to learn how to add horizontal grid lines. Any suggestions would be appreciated. Apologies for the posting error xyplot(est ~ STE, data = all, groups = AREA, type = "b", auto.key = list(space = "right")) For the record, I'm working with Mac OS X 10.4.6 with R 2.3 Thank you.> I've been struggling with this for a while and cannot get it to work. > Is there a simple way to add grid lines ---- I'd like to only add the > horizontal ones --- when using the groups argument in xyplot? > I can get the grid lines to plot, or the points/lines, but not both. > Here is a simple example of the sort of thing that I'm working with. > Thanks, in advance. > > >all > est STE AREA > -0.229 V1 V1 > -1.129 V1 V2 > -2.084 V1 V4 > -2.918 V1 V3 > -0.548 V2 V1 > -0.217 V2 V2 > -1.937 V2 V3 > -1.205 V2 V4 > -4.126 V4 V1 > -1.481 V4 V2 > -2.070 V4 V3 > -0.042 V4 V4 > > xyplot(est ~ ISITE, data = all2, groups = AREA, type = "b", > auto.key = list(space = "right")) >Ken Knoblauch -- Ken Knoblauch Inserm U371 Cerveau et Vision Dept. of Cognitive Neuroscience 18 avenue du Doyen L?pine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.lyon.inserm.fr/371/
Deepayan Sarkar
2006-May-18 18:16 UTC
[R] adding grid lines to an xyplot when there is only 1 panel - corrected
On 5/18/06, ken knoblauch <knoblauch at lyon.inserm.fr> wrote:> Sorry, some things got garbled in that request for help that might make > my request > unintelligible, probably it being too late at night when I posted, here > is the corrected function > call for which I would like to learn how to add horizontal grid lines. > Any suggestions > would be appreciated. Apologies for the posting error > > xyplot(est ~ STE, data = all, groups = AREA, type = "b", > auto.key = list(space = "right"))Write your own panel function, e.g. xyplot(est ~ STE, data = all, groups = AREA, type = "b", panel = function(...) { panel.grid(h = -1, v = 0) panel.xyplot(...) }, auto.key = list(space = "right")) See ?panel.grid for more options. Deepayan