[R] How to force x AND y log scale in xyplot?

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Oct 13 00:52:43 CEST 2006


On 10/12/06, Thomas P. Colson <tpcolson at ncsu.edu> wrote:
>  the following plots a log-log plot of cumulative drainage area, but the
> axis labels are 10^-1, ...10^5, so forth.
>
> xyplot(white$rank.PRank~white$basin_area,scales=list(log=TRUE),xlab="Drainag
> e Area m^2",ylab="P(A>A*)")
>
>
>
>
>
> When I try this, I get the desired labels, sort of: the x axis contains
> "100, 1000,10000" and then "1e+05, 1e+06"
>
> xyplot(white$rank.PRank~white$basin_area,scales=list(y=list(log=TRUE,at=c(.0
> 001,.001,.01,.1,1)),x=list(log=TRUE,at=c(10,100,1000,10000,100000,1000000)))
> ,xlab="Drainage Area m^2",ylab="P(A>A*)")
>
> How to make those last two x-axis labels "conform"?

Specify a 'labels' as well, e.g.

x=list(log=TRUE,
       at=c(10,100,1000,10000,100000,1000000),
       labels = c("10","100","1000","10000","100000","1000000"))

-Deepayan



More information about the R-help mailing list