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

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue 23 Jan 2007 - 15:44:19 GMT

Another approach is shown in the last example at the bottom of:

library(zoo)
?xyplot.zoo

On 1/23/07, Helmut Schütz <helmut.schuetz@bebac.at> wrote:
> 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
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Wed Jan 24 03:04:48 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 24 Jan 2007 - 13:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.