Hi all, I'm trying to find a way to get xyplot to produce a second set of axes outside the right hand side of the graph. This is my progress so far: EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) prepanel.loess(x, y, span = 1), xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", panel = function(x, y) { panel.grid(h=-1, v= 2) panel.xyplot(x, y) panel.loess(x,y, span=1) panel.axis(side = "right", at = c(1, 3), labels = c(1, 3), outside = T) }, aspect = "xy") Does anyone have any suggestions? Thanks much! Andrew -- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : andrewr at uidaho.edu PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion. ----- Original Message ----- From: Werner Bier <aliscla at yahoo.com> Date: Monday, June 13, 2005 9:27 am Subject: Re: [R] kalman filter> yep! please type > ?KalmanLike > or check the dse libraries > Tom > > m p <mzp3769 at yahoo.com> wrote: > Hello, > is there any implementation of Kalman filter in R? > Thanks, > Mark > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html > > > --------------------------------- > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html
Hi Andrew Robinson wrote:> Hi all, > > I'm trying to find a way to get xyplot to produce a second set of axes outside the right hand side of the graph. This is my progress so far: > > EE <- equal.count(ethanol$E, number=9, overlap=1/4) > xyplot(NOx ~ C | EE, data = ethanol, > prepanel = function(x, y) prepanel.loess(x, y, span = 1), > xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", > panel = function(x, y) { > panel.grid(h=-1, v= 2) > panel.xyplot(x, y) > panel.loess(x,y, span=1) > panel.axis(side = "right", at = c(1, 3), > labels = c(1, 3), outside = T) > }, > aspect = "xy") > > Does anyone have any suggestions?I suspect the output from panel.axis() is getting clipped. You might get it to work as follows ... EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) { prepanel.loess(x, y, span = 1) }, xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", panel = function(x, y) { panel.grid(h=-1, v= 2) panel.xyplot(x, y) panel.loess(x,y, span=1) # don't call panel.axis in here }, aspect = "xy") # return to the right-most panel WITH CLIPPING OFF trellis.focus("panel", 9, 1, clip.off=TRUE) # draw the extra axis panel.axis(side = "right", at = c(1, 3), labels = c(1, 3), outside = T) trellis.unfocus() Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Paul, thanks! An elegant solution. Andrew -- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : andrewr at uidaho.edu PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion. ----- Original Message ----- From: Paul Murrell <p.murrell at auckland.ac.nz> Date: Thursday, June 16, 2005 7:07 pm Subject: Re: [R] Plotting second axes outside xyplot> Hi > > > Andrew Robinson wrote: > > Hi all, > > > > I'm trying to find a way to get xyplot to produce a second set > of axes outside the right hand side of the graph. This is my > progress so far: > > > > EE <- equal.count(ethanol$E, number=9, overlap=1/4) > > xyplot(NOx ~ C | EE, data = ethanol, > > prepanel = function(x, y) prepanel.loess(x, y, span = 1), > > xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", > > panel = function(x, y) { > > panel.grid(h=-1, v= 2) > > panel.xyplot(x, y) > > panel.loess(x,y, span=1) > > panel.axis(side = "right", at = c(1, 3), > > labels = c(1, 3), outside = T) > > }, > > aspect = "xy") > > > > Does anyone have any suggestions? > > > I suspect the output from panel.axis() is getting clipped. You > might > get it to work as follows ... > > EE <- equal.count(ethanol$E, number=9, overlap=1/4) > xyplot(NOx ~ C | EE, data = ethanol, > prepanel = function(x, y) { > prepanel.loess(x, y, span = 1) > }, > xlab = "Compression Ratio", > ylab = "NOx (micrograms/J)", > panel = function(x, y) { > panel.grid(h=-1, v= 2) > panel.xyplot(x, y) > panel.loess(x,y, span=1) > # don't call panel.axis in here > }, > aspect = "xy") > # return to the right-most panel WITH CLIPPING OFF > trellis.focus("panel", 9, 1, clip.off=TRUE) > # draw the extra axis > panel.axis(side = "right", at = c(1, 3), > labels = c(1, 3), outside = T) > trellis.unfocus() > > > Paul > -- > Dr Paul Murrell > Department of Statistics > The University of Auckland > Private Bag 92019 > Auckland > New Zealand > 64 9 3737599 x85392 > paul at stat.auckland.ac.nz > http://www.stat.auckland.ac.nz/~paul/ > >