Skip to content

Instantly share code, notes, and snippets.

@informationsea
Created September 19, 2012 04:51
Show Gist options
  • Save informationsea/3747741 to your computer and use it in GitHub Desktop.
Save informationsea/3747741 to your computer and use it in GitHub Desktop.
Draw bw-plot
library(lattice)
mybwplot <- function(x, y, interval=0.2, ylab=deparse(substitute(y)), xlab=deparse(substitute(x)), main="", sub="") {
bwplot(y ~ factor(trunc(x/interval)*interval), xlab=xlab, ylab=ylab, main=main, sub=sub,
panel=function(...){
panel.grid(h=-1, v=0)
panel.bwplot(...)
}, scales=list(rot=c(45,0)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment