[R] doubleYScale from latticeExtra, problems with style

Duncan Mackay dulcalma at bigpond.com
Thu Aug 7 08:08:54 CEST 2014


Hi Troels

Try this

(sd1 <- doubleYScale(obj1,obj2,add.ylab2 = TRUE, use.style = FALSE))

update(sd1,
    par.settings = list(axis.text = list(cex = 1.2),
                        par.ylab.text = list(cex = 1.5)))

Amended sd to sd1

Unfortunately doubleYScale uses themes which makes things difficult

The use.style negates the use of styles apparently 
Have a good read of doubleYScale help page 

Duncan

Duncan
Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Troels Ring
Sent: Wednesday, 6 August 2014 16:34
To: Dennis Murphy; r-help at r-project.org
Subject: Re: [R] doubleYScale from latticeExtra, problems with style

Hi Dennis - thanks a lot - I do not seem to make any progress from 
reading the pages in the lattice book or the documentation of the 
doubleYScale function.
All best wishes
Troels



Den 05-08-2014 20:49, Dennis Murphy skrev:
> Hi:
>
> This *partially* works, although I don't see why it shouldn't work
completely:
>
> update(sd,
>     par.settings = list(axis.text = list(cex = 1.2),
>                         par.ylab.text = list(cex = 1.5)))
>
> It fixes the y-axis text sizes, but it doesn't fix the size of the
> Y-variable names. See pp. 125-126 of the Lattice book for a
> description.
>
> Dennis
>
> On Tue, Aug 5, 2014 at 10:22 AM, Troels Ring <tring at gvdnet.dk> wrote:
>> Dear friends - below is a small example showing a problem I have
>> understanding doubleYScale from latticeExtra -
>> R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
>> Copyright (C) 2013 The R Foundation for Statistical Computing
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>
>> Both obj1 and obj2 are formatted as I wanted - but when combined the
>> formatting is lost. How comes?
>> Best wishes
>> Troels Ring
>> Aalborg, Denmark
>>
>> library(latticeExtra)
>> T <- seq(1,200,length=100)
>> Y1 <- 10+2*T+0.05*T^2 + rnorm(100,0,40)
>> Y2 <- 0.1 + sqrt(T)+rnorm(100,1,1)
>> tesobj <- data.frame(T=T,Y1=Y1,Y2=Y2)
>>
>>
>> obj1 <-
>> xyplot(Y1~T,tesobj,xlab=list(label="Time",cex=1.5),ylab=list(label="Y1",
>> cex=1.5),scales=list(y=list(cex=1.2),x=list(cex=1.2)),
>> panel = function(x,y,...){
>> panel.xyplot(x,y,...,pch=19)
>> panel.loess(x,y,...,lwd=3)
>> })
>> obj1
>>
>> obj2 <-
>> xyplot(Y2~T,tesobj,xlab=list(label="Time",cex=1.5),ylab=list(label="Y2",
>> cex=1.5),scales=list(y=list(cex=1.2),x=list(cex=1.2)),
>> panel = function(x,y,...){
>> panel.xyplot(x,y,...,pch=20)
>> panel.loess(x,y,...,lwd=3)})
>> obj2
>>
>> (sd <- doubleYScale(obj1,obj2,add.ylab2=TRUE))
>>
>> ______________________________________________
>> 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