s-news
[Top] [All Lists]

Re: Formatting trellis graphics

To: "Riley, Steve" <Steve.Riley@pfizer.com>
Subject: Re: Formatting trellis graphics
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Mon, 22 Aug 2005 10:39:54 -0500
Cc: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
In-reply-to: <D5D1C94BFC52BB47AE84BD29EA89778D0296A57F@groamrexm02.amer.pfizer.com>
Organization: PDF Solutions, Inc.
References: <D5D1C94BFC52BB47AE84BD29EA89778D0296A57F@groamrexm02.amer.pfizer.com>
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)


Riley, Steve wrote:
All,
I have a 2 questions regarding formatting of trellis graphics. Using the plot generated by the code below as an example, how might I, 1) change the font of the axis tick labels and 2) generate the plot without the top and right side axes. Using traditional graphics, these items are modifiable using par(font = 2, bty = 'l') but I have been unsuccessful in getting a similar result using trellis graphics. Any input from the group would be greatly appreciated! Thank you. y <- c(1:10,1:10*2)
x <- c(rep(1:10,2))
id <- c(rep(1,10), rep(2,10))
data <- cbind.data.frame(TIME = x, CONC = y,ID = id)
#
#    Set font for axis labels
#
add.text <- trellis.par.get("add.text")
add.text$font <- 2
trellis.par.set("add.text",add.text)
xyplot(CONC~TIME, data = data, groups = ID, panel = panel.superpose, type = 'b')

Hi, Steve,

For question 1, try adding a scales list with your font argument.

For question 2, try adding alternating = FALSE. This may not do what you want since the tick marks are still there, but you do get more space than with the default.

xyplot(..., scales = list(font = 2, alternating = FALSE)))

HTH,

--sundar

<Prev in Thread] Current Thread [Next in Thread>