r - adding and removing grid lines from a lattice histogram -


i have following code, creates histogram:

inst <- data.frame(c(10:27),c(76,97,128,135,137,141,110,94,67,44,39,26,19,12,7,5,2,1)) names(inst) <- c("instsize","noofinst") library(lattice) trellis.par.set(theme = col.whitebg())  myplot <- xyplot(noofinst ~ instsize, data = inst,               type = c("h", "g"), col = "blue",              xlab = "instance size (number of aircraft)",              ylab = "number of instances",              scales=list(                y=list(                  at=seq(0,150,10),                  labels=seq(0,150,10) ),                x=list(                  at=seq(10,27,1),                  labels=seq(10,27,1) )              )              ) 

i add grid lines every tick in y axis , remove of vertical grid lines. possible?

thanks

myplot <- xyplot(noofinst ~ instsize, data = inst,                   type = "h", col = "blue",                  xlab = "instance size (number of aircraft)",                  ylab = "number of instances",                  scales=list(                    y=list(                      at=seq(0,150,10),                      labels=seq(0,150,10) ),                    x=list(                      at=seq(10,27,1),                      labels=seq(10,27,1) )                  ),                  panel=function(...){                    panel.abline(h=seq(0,150,10))                    panel.xyplot(...)                  } ) 

you can change color of horizontal lines defining col within panel.abline() function.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -