[R] Number format in log-scaled lattice xyplots

0 views
Skip to first unread message

Desany, Brian

unread,
Oct 4, 2008, 12:31:42 PM10/4/08
to r-h...@r-project.org
For a non-log-scaled y-axis, I was able to change the appearance of the
y tick labels in an xyplot by using a custom function for
yscale.components. However I couldn't get that approach to work for when
scales=list(y=list(log=TRUE)).

What I'm trying to do is make the y-tick labels show up as something
like (10, 100, 1000, etc.) rather than the default (10^1.0, 10^2.0,
10^3.0, etc.).

Thanks in advance for any suggestions.

Brian

[[alternative HTML version deleted]]

______________________________________________
R-h...@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.

Deepayan Sarkar

unread,
Oct 4, 2008, 6:53:14 PM10/4/08
to Desany, Brian, r-h...@r-project.org
On 10/4/08, Desany, Brian <brian....@roche.com> wrote:
> For a non-log-scaled y-axis, I was able to change the appearance of the
> y tick labels in an xyplot by using a custom function for
> yscale.components. However I couldn't get that approach to work for when
> scales=list(y=list(log=TRUE)).
>
> What I'm trying to do is make the y-tick labels show up as something
> like (10, 100, 1000, etc.) rather than the default (10^1.0, 10^2.0,
> 10^3.0, etc.).

Doesn't the first (densityplot) example in ?yscale.components.default
do this? Other relevant examples are

http://lmdvr.r-forge.r-project.org/figures/figures.html?chapter=08;figure=08_04

and

http://lmdvr.r-forge.r-project.org/figures/figures.html?chapter=08;figure=08_05

-Deepayan

Desany, Brian

unread,
Oct 5, 2008, 1:17:10 PM10/5/08
to Deepayan Sarkar, r-h...@r-project.org
Thanks - I wasn't thinking about it the right way, and I didn't know
where to focus my investigation of the examples.

Thank you very much for pointing me at the specific example that solved
my problem.

For others who might have the same question, that would be the part of
the example that transforms the label values using 2^value, which turns
the label from something that looks like "2^3" into an actual 8.

Actually, other parts of the example are also very enlightening for
other useful things to do with tick labels.

Brian

Reply all
Reply to author
Forward
0 new messages