[R] Lattices: Cloud: Background
Mulholland, Tom
Tom.Mulholland at health.wa.gov.au
Fri Jan 16 07:51:10 CET 2004
When I first started using lattice I found the colour schemes a bit
confusing. So eventually I came up with the colours I wanted.
The code below was one of those attempts. One thing that happened
however was that I kept shutting down the graphics window that pops up
and the colours would revert to their default. So if you run all of the
code the first window will pop up correctly the system will pause for 5
seconds, close the window and run the code again. When the code runs it
reverts to the grey background.
Keep persevering because when it all comes together you can produce some
very good looking graphics.
Note: Not all the colours on the plot are set using lset. The text in
the key is set directly within the xyplot call.
require(lattice)
SetAltColBlue <- function(x=NULL)
{
lset(list(background = list(col = "transparent"),
add.text=list(col="yellow",cex=1.3),
add.line=list(col="navy",cex=1.3),
bar.fill = list(col = "transparent"),
box.rectangle = list(col = "grey"),
box.umbrella = list(col = "grey"),
box.dot = list(col="grey"),
dot.line = list(col = "grey"),
dot.symbol = list(col = "grey"),
plot.line = list(col = "grey"),
plot.symbol = list(col = "grey"),
regions = list(col = heat.colors(100)),
strip.shingle = list(col = c("steelblue1")),
strip.background = list(col = c("navy")),
reference.line = list(col = "navy"),
axis.text=list(col="navy",cex=0.8),
axis.line=list(col="grey50"),
superpose.line = list(col = c("navy", "navy", "navy",
"navy", "navy", "navy", "navy"), lty =
1:7,lwd=c(1.5,1.5,1.5,1,1,1,1)),
superpose.symbol =
list(col=c("steelblue1","navy","blue","black")),
par.xlab.text = list(col="navy",cex=0.9),
par.ylab.text = list(col="navy",cex=0.9),
par.main.text = list(col="navy",cex=2),
par.sub.text = list(col="navy",cex=0.8),
box.3d=list(col="grey")))
}
SetAltColBlue()
data(iris)
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width |
Species,
data = iris, allow.multiple = TRUE, scales = "free",
layout = c(2, 2),
main="Title",sub="sub text",
auto.key = list(col="steelblue4",x = .6, y = .7, corner = c(0,
0)))
bringToTop()
Sys.sleep(5)
dev.off()
data(iris)
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width |
Species,
data = iris, allow.multiple = TRUE, scales = "free",
layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
Ciao, Tom
_________________________________________________
Tom Mulholland
Senior Policy Officer
WA Country Health Service
Tel: (08) 9222 4062
The contents of this e-mail transmission are confidential and may be
protected by professional privilege. The contents are intended only for
the named recipients of this e-mail. If you are not the intended
recipient, you are hereby notified that any use, reproduction,
disclosure or distribution of the information contained in this e-mail
is prohibited. Please notify the sender immediately.
-----Original Message-----
From: Mueller, Adrienne [mailto:adrienne.mueller at imperial.ac.uk]
Sent: Friday, 16 January 2004 3:05 AM
To: R-help at stat.math.ethz.ch
Subject: [R] Lattices: Cloud: Background
Hi,
There's probably some simple way of doing this, but I'm just not seeing
it - How do I get the background to be white instead of grey when I have
a cloud plot (using the lattices package)? par(bg="white") isn't
working. I'm assuming par commands won't work on lattice plots. What
should I use instead?
Thanks,
Adrienne
[[alternative HTML version deleted]]
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list