[R] Lattice scales question: using "at" when log = TRUE

Gabor Grothendieck ggrothendieck at gmail.com
Sun May 17 16:34:20 CEST 2009


There is no reason to think it would
show up since its outside the range
of your data.

Use ylim to expand the range of the
axis if you want it.

On Sun, May 17, 2009 at 10:29 AM, Afshartous, David
<DAfshartous at med.miami.edu> wrote:
>
> On my machine the 10^1 tick mark does not show up.
>
>> sessionInfo()
> R version 2.9.0 (2009-04-17)
> i386-apple-darwin8.11.1
>
> locale:
> en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] lattice_0.17-22
>
> loaded via a namespace (and not attached):
> [1] grid_2.9.0
>
>
>
> On 5/16/09 9:03 PM, "Deepayan Sarkar" <deepayan.sarkar at gmail.com> wrote:
>
> On 5/16/09, Afshartous, David <DAfshartous at med.miami.edu> wrote:
>>
>>
>>  Thanks, but even with typo corrected as below the supplied marks are not followed:
>>  xyplot(y ~ t, type = "b", scales = list(y = list(log = TRUE, at = c(10^1,10^2, 10^2.5, 10^3))))
>>
>
> How so? Looks OK to me.
>
> -Deepayan
>
>
>>
>>
>>  ________________________________________
>>  From: Gabor Grothendieck [ggrothendieck at gmail.com]
>>  Sent: Saturday, May 16, 2009 6:11 PM
>>  To: Afshartous, David
>>  Cc: r-help at r-project.org
>>  Subject: Re: [R] Lattice scales question: using "at" when log = TRUE
>>
>>
>>  Your parentheses are wrong.  It should be
>>
>>  y = list(log = TRUE, at = ...)
>>
>>
>>  On Sat, May 16, 2009 at 5:11 PM, Afshartous, David
>>  <DAfshartous at med.miami.edu> wrote:
>>  >
>>  > All,
>>  >
>>  > I have a simple lattice plot where I have set log = TRUE for the y scale.
>>  >
>>  > When I attempt to change the tick locations via the "at" argument within
>>  > scales, the supplied numeric vector is not followed. Any suggestions much
>>  > appreciated for the example below:
>>  >
>>  > y = c(10^1.5, 10^2, 10^3, 10^2)
>>  > t = c(1,2,3,4)
>>  > xyplot(y ~ t, type = "b", scales = list(y = list(log = TRUE)))
>>  >
>>  > ## tick marks not followed for supplied marks below:
>>  > xyplot(y ~ t, type = "b", scales = list(y = list(log = TRUE), at = c(10^1,
>>  > 10^2, 10^2.5, 10^3)))
>>  >
>>  > Cheers,
>>  > David
>>  >
>>  > PS -
>>  > Another thing is that the scale is no longer in scientific notations, but
>>  > that is okay since this can be fixed via the labels argument within scales:
>>  > e.g., labels = c(expression(10^1), expression(10^2), ...)
>>  > An example of fancy labels for log axes is on p.147 of Deepayan's Lattice
>>  > book.
>>  >
>>  > ______________________________________________
>>  > R-help at r-project.org 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 at r-project.org 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.
>>
>
>
>




More information about the R-help mailing list