A conditioning factor for bwplot() is the stream name. There are 17 streams so each panel is comparatively small and the names in the panel header are truncated at both ends. I would like to wrap the names on two lines for each panel but do not see if this can be done when I look at the online docs (?bwplot) or the Lattice book. Is there a way to fit long strings as headers with multiple panels on a page? Rich
bwplot(): Can Panel Heading Span Two Lines?
6 messages · David Winsemius, Rich Shepard, Bert Gunter
On Sep 10, 2012, at 11:35 AM, Rich Shepard wrote:
A conditioning factor for bwplot() is the stream name. There are 17 streams so each panel is comparatively small and the names in the panel header are truncated at both ends. I would like to wrap the names on two lines for each panel but do not see if this can be done when I look at the online docs (?bwplot) or the Lattice book. Is there a way to fit long strings as headers with multiple panels on a page?
The text that appears in the "panel header" is called the "strip". I didn't see it in the help page for bwplot. You need to look at: ?strip.custom. And since you have the Lattice book look at section 10.7 'Controlling the appearance of strips"
David Winsemius, MD Alameda, CA, USA
On Mon, 10 Sep 2012, David Winsemius wrote:
The text that appears in the "panel header" is called the "strip". I didn't see it in the help page for bwplot. You need to look at:
David, That explains why I did not find it in the book's index.
?strip.custom. And since you have the Lattice book look at section 10.7 'Controlling the appearance of strips"
Thanks very much! Rich
In addition, try this:
x <- rep(1:10,2); y <- runif(20);f<-factor(rep(paste("This
is\nLevel",1:2),e=10))
xyplot(y~x|f,
par.strip.text=list(lineheight=.8,lines=3))
I find the documentation here confusing and incomplete:
"par.strip.text" is listed as a parameter both in ?xyplot and
?strip.custom. The arguments are apparently different in the two
cases, although they are not clearly spelled out in either, although I
would guess that the default setting in ?strip.default, "add.text,"
may explain strip.default's. Note that the "lines" component is
missing, for strip.custom() but apparently works in xtplot().
Cheers,
Bert
On Mon, Sep 10, 2012 at 1:33 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
On Mon, 10 Sep 2012, David Winsemius wrote:
The text that appears in the "panel header" is called the "strip". I didn't see it in the help page for bwplot. You need to look at:
David, That explains why I did not find it in the book's index.
?strip.custom. And since you have the Lattice book look at section 10.7 'Controlling the appearance of strips"
Thanks very much! Rich
______________________________________________ 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.
Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
On Sep 10, 2012, at 1:48 PM, Bert Gunter wrote:
In addition, try this:
x <- rep(1:10,2); y <- runif(20);f<-factor(rep(paste("This
is\nLevel",1:2),e=10))
xyplot(y~x|f,
par.strip.text=list(lineheight=.8,lines=3))
Bert;
I had imagined that the factor level character strings could be automagically separated by substituting '\n' at each space or dash or wahtever:
strip.new <- function( which.given, which.panel, factor.levels, ...){
panel.text( x=0.5,y=1.5, lab=gsub("\\ ", "\n", factor.levels) )}
# Need to tweak the line height
xyplot(y~x|f, strip=strip.new)
Your approach of changing the levels to be pre-split with '\n's may be more straightforward.
David. > > I find the documentation here confusing and incomplete: > "par.strip.text" is listed as a parameter both in ?xyplot and > ?strip.custom. The arguments are apparently different in the two > cases, although they are not clearly spelled out in either, although I > would guess that the default setting in ?strip.default, "add.text," > may explain strip.default's. Note that the "lines" component is > missing, for strip.custom() but apparently works in xtplot(). > > Cheers, > Bert > > On Mon, Sep 10, 2012 at 1:33 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote: >> On Mon, 10 Sep 2012, David Winsemius wrote: >> >>> The text that appears in the "panel header" is called the "strip". I >>> didn't see it in the help page for bwplot. You need to look at: >> >> >> David, >> >> That explains why I did not find it in the book's index. >> >>> ?strip.custom. >>> >>> And since you have the Lattice book look at section 10.7 'Controlling the >>> appearance of strips" >> >> >> Thanks very much! >> >> Rich David Winsemius, MD Alameda, CA, USA
On Mon, 10 Sep 2012, Bert Gunter wrote:
In addition, try this:
x <- rep(1:10,2); y <- runif(20);f<-factor(rep(paste("This
is\nLevel",1:2),e=10))
xyplot(y~x|f,
par.strip.text=list(lineheight=.8,lines=3))
Bert, Thanks very much. If the docs are less than clear to you, they will certainly be rather opaque to me. Rich
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863