[R] 2nd Y-axis text problem

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Oct 26 19:03:07 CEST 2004


Sion Roberts wrote:

> Dear All,
> I'm having problems getting text to appear on a second y axis....because
> this can only be done within a plot statement and my attempts to add the
> label as text didn't work because the "locator" refers to the plot
> area....


For axis, see ?axis.
For margin text, see ?mtext.
For plotting arbitrary stuff into the margins, see ?par and its argument 
"xpd".

Uwe Ligges


> Any thoughts greatly appreciated.
> 
> Thanks in advance,
> Sion
> 
> 
>>par(mai=c(1,1,1,1.5))
>>plot(time[DOY<230],Hmeas[DOY < 230],ylab=expression(paste("Fluxes,
> 
> W",m^-2)),xlab="Time of Day,
> hours",ylim=c(-100,500),typ="l",lty=1,lwd=1,col=1,axes=F)
> 
> 
>>axis(2,at=c(-100,0,100,200,300,400,500),tick=T)
>>axis(1,at=c(0,6,12,18,24),tick=T) par(new=T)
> 
> 
>>plot(time[DOY<230],Ueddy[DOY<230],xlab="",yaxt="n",ylab="",ylim=c(0,1.6),pch=1,axes=F)
>>axis(4,at=c(0,0.4,0.8,1.2,1.6),tick=T) # **problem**
> 
> 
> ______________________________________________
> R-help at 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




More information about the R-help mailing list