Skip to content

[Lattice] Incrase the height of strips in Trellis plots

4 messages · Bernd Weiss, Frede Aakmann Tøgersen, Deepayan Sarkar

#
Dear all,

I wonder how to increase the height of strips via strip.default or
strip.custom. The following example hopefully illustrates the difficulty
I am facing:

library(lattice)
xyplot(Petal.Length ~ Petal.Width | Species, iris,
        strip = strip.custom(par.strip.text = list(cex = 2)))

Thanks for any advice,

Bernd
_
platform       i386-pc-mingw32
arch           i386
os             mingw32
system         i386, mingw32
status
major          2
minor          5.1
year           2007
month          06
day            27
svn rev        42083
language       R
version.string R version 2.5.1 (2007-06-27)
#
This should give you something close to what you want:


xyplot(Petal.Length ~ Petal.Width | Species, iris,
       strip = strip.custom(par.strip.text = list(cex = 2)),
       par.settings = list(layout.heights=list(strip=1.45)))

The par.settings argument alters locally the default par settings of lattice plots, see e.g. ?trellis.par.get and the ?xyplot about the par.settings argument.

A closer inspection (try using strip = 2 or numbers less than 1.45 in stead of strip = 1.45) of the figure reveals that there are some problems with vertical alignment of the strip text, i.e. not centered. 

To remedy this I think that you have to use you own strip function. You may be able to build you own function by altering the default strip function, see ?lattice.options and try lattice.options() at the command prompt. However this may be more difficult than it seems at first. Perhaps some one more familiar with the lattice package can solve this.
 

Best regards

Frede Aakmann T?gersen
Scientist


UNIVERSITY OF AARHUS
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology
Blichers All? 20, P.O. BOX 50
DK-8830 Tjele

Phone:   +45 8999 1900
Direct:  +45 8999 1878

E-mail:  FredeA.Togersen at agrsci.dk
Web:	   http://www.agrsci.org				

This email may contain information that is confidential.
Any use or publication of this email without written permission from Faculty of Agricultural Sciences is not allowed.
If you are not the intended recipient, please notify Faculty of Agricultural Sciences immediately and delete this email.
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frede Aakmann T?gersen schrieb:
Perfect! Thank you very much,

Bernd


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG3l5cUsbvfbd00+ERAh1qAJ4tw3ZiIYnI+UF6FJeLT1xRMep/VACfR+I1
R14RJkdaFBNFqVc6kibyaRk=
=W41I
-----END PGP SIGNATURE-----
#
On 9/5/07, Frede Aakmann T?gersen <FredeA.Togersen at agrsci.dk> wrote:
Another possibility that predates par.settings (but is basically equivalent) is

xyplot(Petal.Length ~ Petal.Width | Species, iris,
       par.strip.text = list(lines = 2, cex = 2))

-Deepayan