s-news
[Top] [All Lists]

Re: Color of a Trellis Box Plot

To: phlasky@earthlink.net
Subject: Re: Color of a Trellis Box Plot
From: Sundar Dorai-Raj <sundar.dorai-raj@PDF.COM>
Date: Tue, 23 Dec 2003 07:02:41 -0600
Cc: s-news <s-news@lists.biostat.wustl.edu>
In-reply-to: <410-2200312122231663@earthlink.net>
Organization: PDF Solutions, Inc.
References: <410-2200312122231663@earthlink.net>
Reply-to: sundar.dorai-raj@PDF.COM
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


Paul Lasky wrote:
My Splus 6.1 (running on XP) produces a sickly turquoise colored box plot when I call the trellis function bwplot. How do I change the color from the awful turquoise ? Adding a "col" parameter [e.g. bwplot( Capitaliztion ~ MoRet, data= moret, col = 7) ] doesn't do the trick; it simply changes the color of the central dot in the box to a nice yellow while leaving the turquoise box and whiskers unchanged. In fact on all trellis plots the graph line is plotted in this awful color. So how do I change the default ?

You'll need to change the trellis settings. See ?trellis.par.set:

br <- trellis.par.get("box.rectangle")
br$col <- 7
trellis.par.set("box.rectangle", br)
bu$col <- 7
trellis.par.set("box.umbrella", bu)
x <- data.frame(y = rnorm(20), z = rep(1:2, each =10))
bwplot(z ~ y, x)

Sometimes I find it easier to just set up a different colour scheme before calling trellis at all:

trellis.device(graphsheet, color.table = "0,0,0|0,0,255|0,255,0|255,0,0|255,255,255")
bwplot(z ~ y, x)

which maps col = 2 to "blue" (plus gets rid of that awful gray background). See ?graphsheet for other options.

Regards,
Sundar


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