[R] Second axis on bottom of graph

Jim Lemon jim at bitwrit.com.au
Mon May 19 07:13:55 CEST 2014


On Sun, 18 May 2014 09:56:03 PM Hurr wrote:
> Sorry, I'm enclosing incomplete not-runnable code.
> 
> 
axis(1,tick=TRUE,at=horTicLocs,labels=rep("",length(horLabels)),padj=0)
> staxlab(1,at=horTicLocs,labels=horLabels,srt=90,adj=c(1,0))
> nFrqTicInvls=9; frqTicLocs <- vector(length=nFrqTicInvls+1);
> frqLabels <- vector(length=nFrqTicInvls+1);
> frqInvl=(horAxisLims[2]-horAxisLims[1])/nFrqTicInvls
> for(i in 1:(nFrqTicInvls+1))frqTicLocs[i]=horAxisLims[1]+(i-1)*frqInvl
> for(i in
> 1:
(nFrqTicInvls+1))frqLabels[i]=.jcall(OuWid,"S","sR",frqTicLocs[i],as.integ
> er(4)) for(i in 1:(nFrqTicInvls+1))print(frqLabels[i])
> 
axis(1,tick=TRUE,line=3.5,at=frqTicLocs,labels=rep("",length(frqLabels)),pad
> j=0) staxlab(1,at=frqTicLocs,labels=frqLabels,srt=90,adj=c(1,0))
> 
> The first axis and first staxlab works.
> The second axis is OK below the first axis.
> The print(frqLabels[i]) is OK.
> But the second staxlab puts the frqLabels[i] on the first (upper) axis.
> I must have to add something to the second staxlab to select second 
axis?
> 
Try looking at the help page, in particular the top.line argument.

Jim



More information about the R-help mailing list