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

From: Helmut Schütz <helmut.schuetz_at_bebac.at>
Date: Wed 24 Jan 2007 - 12:41:29 GMT

thanks for your hints; as a side-effect I learned a lot about lattice.

The working example is:

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

Lower <- 0
Upper <- 1
MajorInterval <- 5 # interval for major ticks MinorInterval <- 4 # interval within major Major <- seq( Lower,Upper,(Upper-Lower)/MajorInterval ) Minor <- seq( Lower,Upper,(Upper-Lower)/(MajorInterval*MinorInterval) ) labl <- as.character(Major)

trellis.focus("panel", 1, 1, clip.off = TRUE) 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(x = list(at = Major), y = list(at = Major), tck=c(1,0), labels=labl, cex=0.9),

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help