Hobie Perry
2008-May-27 15:13 UTC
[R] Fwd: Re: Seeking help with trellis: log scales on xyplot
Deepayan: Sorry for the additional email, but I'm concerned that I wasn't being clear. In the end, I would like a graphic that portrays my y-values on a log scale in their native data range. That is to say, I would prefer to see the axis labels as 1000 rather than 3 (log10 of 1000). Thank you for your kind assistance, Hobie Perry St. Paul, MN Hobie Perry <hobie_perry@yahoo.com> wrote: Date: Tue, 27 May 2008 08:01:13 -0700 (PDT) From: Hobie Perry <hobie_perry@yahoo.com> To: Deepayan Sarkar <deepayan.sarkar@gmail.com> CC: r-help@r-project.org Subject: Re: [R] Seeking help with trellis: log scales on xyplot Deepayan: Thank you for the idea, but this doesn't quite solve the problem. The scale setting creates axes labelled with the logs of the y-axis data, but the data themselves have not been rescaled. The result is a graphic which truncates the data. What I am seeking is a means to rescale the underlying data and then plot them, without having to take the logs myself. This may not be possible. Hobie Perry St. Paul, MN Deepayan Sarkar wrote: On 5/23/08, hobie perry wrote:> > Good afternoon. > > The basic plot function can automatically generate log scales as follows: > > plot(calcium ~ soil_ph, log="y") > > Here is my basic model in xyplot... > > xyplot(calcium+magnesium ~ soil_ph|depth*region) > > I would like the calcium and magnesium values to be reported on a log scale. > I have tried manipulating "scales" and "yscale.components" to no effect.Try something like xyplot(calcium+magnesium ~ soil_ph|depth*region, scales = list(y = list(log = 2))) -Deepayan [[alternative HTML version deleted]] ______________________________________________ R-help@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. [[alternative HTML version deleted]]
Charilaos Skiadas
2008-May-27 16:03 UTC
[R] Fwd: Re: Seeking help with trellis: log scales on xyplot
Does either axis of this graph come close to what you want? http://lmdvr.r-forge.r-project.org/figures/figures.html? chapter=08;figure=08_05 In any case, they might give you some ideas (the code is on the side of the page). I don't see why you would not want to take the logs yourself. After all, R will be doing the hardest part of taking logs for you. All you'll have to do is add the word "log" on both sides of the formula. Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 27, 2008, at 11:13 AM, Hobie Perry wrote:> Deepayan: > > Sorry for the additional email, but I'm concerned that I wasn't > being clear. > > In the end, I would like a graphic that portrays my y-values on a > log scale in their native data range. That is to say, I would > prefer to see the axis labels as 1000 rather than 3 (log10 of 1000). > > Thank you for your kind assistance, > Hobie Perry > St. Paul, MN > > Hobie Perry <hobie_perry at yahoo.com> wrote: Date: Tue, 27 May 2008 > 08:01:13 -0700 (PDT) > From: Hobie Perry <hobie_perry at yahoo.com> > To: Deepayan Sarkar <deepayan.sarkar at gmail.com> > CC: r-help at r-project.org > Subject: Re: [R] Seeking help with trellis: log scales on xyplot > > Deepayan: > > Thank you for the idea, but this doesn't quite solve the problem. > > The scale setting creates axes labelled with the logs of the y-axis > data, but the data themselves have not been rescaled. The result is > a graphic which truncates the data. > > What I am seeking is a means to rescale the underlying data and > then plot them, without having to take the logs myself. This may > not be possible. > > Hobie Perry > St. Paul, MN > > Deepayan Sarkar wrote: On 5/23/08, hobie perry wrote: >> >> Good afternoon. >> >> The basic plot function can automatically generate log scales as >> follows: >> >> plot(calcium ~ soil_ph, log="y") >> >> Here is my basic model in xyplot... >> >> xyplot(calcium+magnesium ~ soil_ph|depth*region) >> >> I would like the calcium and magnesium values to be reported on a >> log scale. >> I have tried manipulating "scales" and "yscale.components" to no >> effect. > > Try something like > > xyplot(calcium+magnesium ~ soil_ph|depth*region, > scales = list(y = list(log = 2))) > > -Deepayan >