[R] panel plot with log-scaled x-axis

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.ac.be
Wed Feb 9 14:51:48 CET 2005


then try this:

library(lattice)
xyplot(conc~uptake|Treatment+Type, data=CO2,
scales=list(x=list(log=TRUE, at=c(10^1, 10^1.2, 10^1.4, 10^1.6),
labels=letters[1:4])))


Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Christoph Scherber" <Christoph.Scherber at uni-jena.de>
To: "Dimitris Rizopoulos" <dimitris.rizopoulos at med.kuleuven.ac.be>
Sent: Wednesday, February 09, 2005 1:59 PM
Subject: Re: [R] panel plot with log-scaled x-axis


> Hi,
>
> Yes, that works great! But how can I now change the x axis tick 
> labels look better (eg., give a sequence that shall be plotted)?
>
> Regards
> Christoph
>
> Dimitris Rizopoulos wrote:
>
>> I am not sure if this is what you want, but try:
>>
>> library(lattice)
>> xyplot(conc~uptake|Treatment+Type, data=CO2, 
>> scales=list(x=list(log=TRUE)))
>>
>> I hope it helps.
>>
>> Best,
>> Dimitris
>>
>> ----
>> Dimitris Rizopoulos
>> Ph.D. Student
>> Biostatistical Centre
>> School of Public Health
>> Catholic University of Leuven
>>
>> Address: Kapucijnenvoer 35, Leuven, Belgium
>> Tel: +32/16/336899
>> Fax: +32/16/337015
>> Web: http://www.med.kuleuven.ac.be/biostat/
>>     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
>>
>>
>> ----- Original Message ----- From: "Christoph Scherber" 
>> <Christoph.Scherber at uni-jena.de>
>> To: "Deepayan Sarkar" <deepayan at stat.wisc.edu>
>> Cc: <r-help at stat.math.ethz.ch>
>> Sent: Wednesday, February 09, 2005 11:07 AM
>> Subject: Re: [R] panel plot with log-scaled x-axis
>>
>>
>>> Hi,
>>>
>>> I´ll try to rephrase my question using the following example:
>>>
>>> xyplot(conc~uptake|Treatment+Type,data=CO2)
>>>
>>> Would it be possible to make each of the x axes log-scaled (but 
>>> with the same tick labels)?
>>>
>>> Thanks very much!
>>> Christoph
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Deepayan Sarkar wrote:
>>>
>>>> On Tuesday 08 February 2005 10:19, Christoph Scherber wrote:
>>>>
>>>>> Dear all,
>>>>>
>>>>> Can anyone help me plotting a panel plot with log-scaled x axes?
>>>>>
>>>>> My formula looks like this:
>>>>>
>>>>> coplot(response~div|treatment+grass,
>>>>> panel=function(x,y,...){panel.xyplot(x,y,...);panel.lmline(x,y,...)})
>>>>>
>>>>
>>>> Are you sure that actually works?
>>>>
>>>>> And I´d like to have "div" plotted in log scale.
>>>>>
>>>>
>>>> How to do that would depend at least on whether you are using 
>>>> coplot or xyplot (neither may have good solutions implemented).
>>>>
>>>> Deepayan
>>>>
>>>>
>>>>
>>>
>>> ______________________________________________
>>> R-help at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide! 
>>> http://www.R-project.org/posting-guide.html
>>>
>>
>>
>




More information about the R-help mailing list