Re: [R] xyplot questions - axis and plotting two things in same panel

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Wed, 25 Jun 2008 16:02:09 -0700

On 6/25/08, Franz Mueter <fmueter_at_alaska.net> wrote:
> As for your first problem, try:
>
> xyplot(numbers~breaks|moltype, groups = type, data = alldata, type = "l")
>
>
> -----Original Message-----
> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On
> Behalf Of Karin Lagesen
> Sent: Wednesday, June 25, 2008 2:13 AM
> To: r-help_at_r-project.org
> Subject: [R] xyplot questions - axis and plotting two things in same panel

[...]

> I am also wondering about whether it is possible to change the x axis
> scale here. I have data going from 0 to 35, but most of the
> interesting stuff is between 0 and 5. Thus I am wondering if there is
> any way of specifying that the 0 to 5 range should take up 30 % of the
> x axis (or something like that) and gradually shrink the axis after
> that. I have tried doing log on the x axis, but I have a lot of zeros
> in my data set that really breaks everything.

Rather than having the software support arbitrary axis transformations, it would be simpler to transform the data; e.g.,

xyplot(numbers~asinh(breaks) | moltype, groups = type, data = alldata, type = "l")

That still leaves the problem of "nice" axis labels in the original scale. That is in general a hard problem. For special cases, you can specify explicit tick positions (in the transformed scale) and associated labels (in the original scale) using the 'scales' argument.

-Deepayan



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. Received on Wed 25 Jun 2008 - 23:09:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 26 Jun 2008 - 11:31:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive