[R] two issues
I'm working on a graphic but have run into a road block about two issues. I don't have a color printer so I want to produce the graphic in black and white. I'm currently using this statement trellis.device(bg=white) but the body of the graphic contains color. What is the code to create the whole thing in black and white. The other issue might be a bit more tricky. I'm using this statement: auto.key=TRUE and in the body of the graphic I'm getting two different symbols and on the screen I see two symbols in the key but when I print it the key only contains one symbol for both! here's the whole R code statement: dotplot(chemical~adjlogmle| convert*tdnew, data=allrisk , group=rodentx, main=Interspecies Conversion, pch=1:2, auto.key=TRUE, scales = list(tick.number=10), fontfamily = HersheySans) Thanks, Dean Sonneborn M.S. Public Health Sciences * University of California, Davis 916 734-6656 * formerly Epidemiology Preventive Medicine [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] two issues
On Thursday 03 February 2005 13:52, Dean Sonneborn wrote: I'm working on a graphic but have run into a road block about two issues. I don't have a color printer so I want to produce the graphic in black and white. I'm currently using this statement trellis.device(bg=white) Doesn't that give you a warning? If not, you are using an older version of R (earlier than 2.0.0). In the latest version, ?trellis.device has a long rant on this issue. but the body of the graphic contains color. What is the code to create the whole thing in black and white. If you want black and white, simply use trellis.device(color = FALSE) The other issue might be a bit more tricky. I'm using this statement: auto.key=TRUE and in the body of the graphic I'm getting two different symbols and on the screen I see two symbols in the key but when I print it the key only contains one symbol for both! auto.key only works if you use the default plotting symbols, it doesn't know that you have specified pch=1:2. The easiest way to handle this would to replace 'pch=1:2' by 'par.settings = list(superpose.symbol = list(pch = 1:2))' (which may not work if your version of R is too old). Deepayan here's the whole R code statement: dotplot(chemical~adjlogmle| convert*tdnew, data=allrisk , group=rodentx, main=Interspecies Conversion, pch=1:2, auto.key=TRUE, scales = list(tick.number=10), fontfamily = HersheySans) Thanks, Dean Sonneborn M.S. Public Health Sciences * University of California, Davis 916 734-6656 * formerly Epidemiology Preventive Medicine __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] two issues (black and white trellis graphics)
On the first issue, there's a recent post you can find in the archives. It's from Deepayan Sarkar on January 2 this year. It would probably pop up on a search for black white lattice or something similar. The key part of his answer: I'd do something like this as part of the initialization: ... library(lattice) ltheme - canonical.theme(color = FALSE) ## in-built BW theme ltheme$strip.background$col - transparent ## change strip bg lattice.options(default.theme = ltheme) ## set as default Hope this helps, Matt Wiener -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dean Sonneborn Sent: Thursday, February 03, 2005 2:53 PM To: R-help@stat.math.ethz.ch Subject: [R] two issues I'm working on a graphic but have run into a road block about two issues. I don't have a color printer so I want to produce the graphic in black and white. I'm currently using this statement trellis.device(bg=white) but the body of the graphic contains color. What is the code to create the whole thing in black and white. The other issue might be a bit more tricky. I'm using this statement: auto.key=TRUE and in the body of the graphic I'm getting two different symbols and on the screen I see two symbols in the key but when I print it the key only contains one symbol for both! here's the whole R code statement: dotplot(chemical~adjlogmle| convert*tdnew, data=allrisk , group=rodentx, main=Interspecies Conversion, pch=1:2, auto.key=TRUE, scales = list(tick.number=10), fontfamily = HersheySans) Thanks, Dean Sonneborn M.S. Public Health Sciences * University of California, Davis 916 734-6656 * formerly Epidemiology Preventive Medicine [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html