[R] How to generate 'minor' ticks in lattice (qqmath)

Helmut Schütz helmut.schuetz at bebac.at
Tue Jan 23 16:36:04 CET 2007


Dear group,

I tried to generate labels for every second tick in lattice (qqmath).
Version: 0.14-16
Date: 2006/12/01

R version 2.4.1 (2006-12-18)

An example:

library(lattice)
numy=100
y=runif(numy,min=0,max=1)
sig=0.05
numsig=length(which(y<sig))

tck.no=11 # number of ticks
tcks=1:tck.no
labl=as.character(0.1*tcks-0.1) # label for all ticks
labl[seq(2,tck.no-1,2)]="" # delete every second label
nums=seq(0,(tck.no-1)/10,(tck.no-1)/100)

qqmath(y,distribution=qunif,
  prepanel=NULL,
  panel=function(x)
    {
    panel.abline(c(0,1),lty=2)
    
panel.polygon(c(0,0,numsig/numy,numsig/numy,0),c(0,sig,sig,0,0),lwd=0.75)
    panel.qqmath(x,distribution=qunif,col=1)
    },
    scales=list(
      tck=c(1,0),
      x=list(at=nums,labels=labl),
      cex=0.8),
    xlab=paste("uniform [0,1] quantiles"),
    ylab="runif [0,1]",
    min=0,max=1)

Two questions:
1. How do I define the same labels for the second (left) axis (I suspect 
a second dimension in scales(list(x=list...) would do the job, but I 
haven't been able finding out, how...
2. Is there any alternative to obtain minor ticks in lattice like 
"minor.ticks" in Hmisc?

Best regards,
Helmut

-- 
Helmut Schütz
BEBAC
Consultancy Services for Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna/Austria
tel/fax +43 1 2311746
Web http://BEBAC.at
BE/BA Forum http://forum.bebac.at
http://www.goldmark.org/netrants/no-word/attach.html



More information about the R-help mailing list