Hi,

I would like to use xyplot to create a figure. Unfortunately, I cannot find
documentation in xyplot to specify alternating the x-axis tick labels with
the x-axis tick marks. I can do this with the regular R plot function as
follows.


#A small version of my data looks like this
data<-data.frame(matrix(ncol=3,nrow=12))
data[,1]<-rep(c(1,2,3),c(4,4,4))
data[,2]<-rep(c(1,2,3,4),3)
data[,3]<-runif(12,0,1)
names(data)<-c("Chromosome", "BasePair", "Pvalue")
#using R's plot function, I would place the the chromosome label between
the
#tick marks as follows:
v1<-c(4,8)
v2<-c(2,6,10)
data$indice<-seq(1:12)
plot(data$indice, -log10(data$Pvalue), type="l", xaxt="n", main="Result",
 xlab="Chromosome", ylab=expression(paste(-log[10]," p-value")))
axis(1, v1,labels=FALSE )
axis(1, v2, seq(1:3), tick=FALSE, cex.axis=.6)

Can this be done with lattice xyplot?


-- 
Leah Preus
Biostatistician
Roswell Park Cancer Institute

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to