Strip height in latticeExtra:::useOuterStrips

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Strip height in latticeExtra:::useOuterStrips

Duncan Mackay-4
Hi all

I use latticeExtra::useOuterStrips quite a bit.
The problem of strip height using useOuterStrips came up some time ago but
did not have the time then to work something out so made do with the
default layout.heights of strip = 1

#Data:

df2 <- structure(list(a = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("1", "2"), class = "factor"),
    b = structure(c(1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
    2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L,
    2L, 2L, 1L, 1L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
    c = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L,
    1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L,
    1L, 1L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
    d = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
    2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
    2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
    rep = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
    2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
    x = c(-0.626453810742333, 0.183643324222082, -0.835628612410047,
    1.59528080213779, 0.329507771815361, -0.820468384118015,
    0.487429052428485, 0.738324705129217, 0.575781351653492,
    -0.305388387156356, 1.51178116845085, 0.389843236411431,
    -0.621240580541804, -2.2146998871775, 1.12493091814311,
-0.0449336090152308,
    -0.0161902630989461, 0.943836210685299, 0.821221195098089,
    0.593901321217509, 0.918977371608218, 0.782136300731067,
    0.0745649833651906, -1.98935169586337, 0.61982574789471,
    -0.0561287395290008, -0.155795506705329, -1.47075238389927,
    -0.47815005510862, 0.417941560199702, 1.35867955152904,
-0.102787727342996
    )), .Names = c("a", "b", "c", "d", "rep", "x"), out.attrs =
structure(list(
    dim = structure(c(2L, 2L, 2L, 2L, 2L), .Names = c("a", "b",
    "c", "d", "rep")), dimnames = structure(list(a = c("a=1",
    "a=2"), b = c("b=1", "b=2"), c = c("c=1", "c=2"), d = c("d=1",
    "d=2"), rep = c("rep=1", "rep=2")), .Names = c("a", "b",
    "c", "d", "rep"))), .Names = c("dim", "dimnames")), row.names = c(NA,
-32L), class = "data.frame")

str(df2)

library(lattice)
library(laticeExtra)

# This is as per normal
xyplot(x~d|paste(a,b)*c, data = df2)

# Increase strip height to use atop later on for 2 lines of text/panel in
strip
# works OK
xyplot(x~d|paste(a,b)*c, data = df2,
       par.settings = list(layout.heights = list(strip = 2.2)))
# no change in strip height
useOuterStrips(xyplot(x~d|paste(a,b)*c, data = df2,
               par.settings = list(layout.heights = list(strip = 2.2))))

I have played around with various vector and list combinations for strip in
layout.heights to no avail
Does any one have an answer?

Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strip height in latticeExtra:::useOuterStrips

Richard M. Heiberger
You had a typo.

library(latticeExtra)

Try this.  I am solving what I think is a problem related to yours.  I set it up
as a three-way plot instead of pasting two of the measures together.

## install.packages("HH") ## if necessary
library(HH)
tmp <- xyplot(x ~ d | a*b*c, data = df2,
       par.settings = list(layout.heights = list(strip = 2.2)))
useOuterStripsT2L1(tmp)

Rich

On Mon, Apr 17, 2017 at 11:20 PM, Duncan Mackay <[hidden email]> wrote:

> Hi all
>
> I use latticeExtra::useOuterStrips quite a bit.
> The problem of strip height using useOuterStrips came up some time ago but
> did not have the time then to work something out so made do with the
> default layout.heights of strip = 1
>
> #Data:
>
> df2 <- structure(list(a = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
> 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
> 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("1", "2"), class = "factor"),
>     b = structure(c(1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
>     2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L,
>     2L, 2L, 1L, 1L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
>     c = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L,
>     1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L,
>     1L, 1L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
>     d = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
>     2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
>     2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
>     rep = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
>     1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
>     2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
>     x = c(-0.626453810742333, 0.183643324222082, -0.835628612410047,
>     1.59528080213779, 0.329507771815361, -0.820468384118015,
>     0.487429052428485, 0.738324705129217, 0.575781351653492,
>     -0.305388387156356, 1.51178116845085, 0.389843236411431,
>     -0.621240580541804, -2.2146998871775, 1.12493091814311,
> -0.0449336090152308,
>     -0.0161902630989461, 0.943836210685299, 0.821221195098089,
>     0.593901321217509, 0.918977371608218, 0.782136300731067,
>     0.0745649833651906, -1.98935169586337, 0.61982574789471,
>     -0.0561287395290008, -0.155795506705329, -1.47075238389927,
>     -0.47815005510862, 0.417941560199702, 1.35867955152904,
> -0.102787727342996
>     )), .Names = c("a", "b", "c", "d", "rep", "x"), out.attrs =
> structure(list(
>     dim = structure(c(2L, 2L, 2L, 2L, 2L), .Names = c("a", "b",
>     "c", "d", "rep")), dimnames = structure(list(a = c("a=1",
>     "a=2"), b = c("b=1", "b=2"), c = c("c=1", "c=2"), d = c("d=1",
>     "d=2"), rep = c("rep=1", "rep=2")), .Names = c("a", "b",
>     "c", "d", "rep"))), .Names = c("dim", "dimnames")), row.names = c(NA,
> -32L), class = "data.frame")
>
> str(df2)
>
> library(lattice)
> library(laticeExtra)
>
> # This is as per normal
> xyplot(x~d|paste(a,b)*c, data = df2)
>
> # Increase strip height to use atop later on for 2 lines of text/panel in
> strip
> # works OK
> xyplot(x~d|paste(a,b)*c, data = df2,
>        par.settings = list(layout.heights = list(strip = 2.2)))
> # no change in strip height
> useOuterStrips(xyplot(x~d|paste(a,b)*c, data = df2,
>                par.settings = list(layout.heights = list(strip = 2.2))))
>
> I have played around with various vector and list combinations for strip in
> layout.heights to no avail
> Does any one have an answer?
>
> Regards
>
> Duncan
>
> Duncan Mackay
> Department of Agronomy and Soil Science
> University of New England
> Armidale NSW 2351
> Email: home: [hidden email]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strip height in latticeExtra:::useOuterStrips

Ismail SEZEN
In reply to this post by Duncan Mackay-4

> On 18 Apr 2017, at 06:20, Duncan Mackay <[hidden email]> wrote:
>
> Hi all
>
> I use latticeExtra::useOuterStrips quite a bit.
> The problem of strip height using useOuterStrips came up some time ago but
> did not have the time then to work something out so made do with the
> default layout.heights of strip = 1

?useOuterStrips gives the following function body:

useOuterStrips(x,
               strip = strip.default,
               strip.left = strip.custom(horizontal = FALSE),
               strip.lines = 1,
               strip.left.lines = strip.lines)

and set strip.lines = 4. Is this what you want?


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Loading...