[R] Color on trellis device

David Winsemius dwinsemius at comcast.net
Wed Nov 17 16:33:07 CET 2010


On Nov 17, 2010, at 4:49 AM, Ronaldo Reis Junior wrote:

> Hi,
>
> I try to make a xyplot withou colors. I try:
>
> pdf(file="test.pdf")
> trellis.device(color=F)
> Depth <- equal.count(quakes$depth, number=8, overlap=.1)
> xyplot(lat ~ long | Depth, data = quakes)
> dev.off()
>
> the graphic is showed without colors in a X device but it dont work
> saving directly on pdf device.

I'm not sure I know the correct answer, but report here the results of  
my guesses:
Guess # 1 (completely wrong) was that the order of the first two lines  
needed to be swapped.
Guess # 2. Look at ?pdf and see that there is a colormodel argument.  
Partially successful but the points inside the panels and the edges of  
the strip markers still show color.
Guess # 3: add col="black" to the xyplot call. Still leaves the orange  
edges on the strip markers but is about 98% free of color.
Guess # 4: Remembering that the Lattice book website had different  
color themes I went there to see if I could get code. Didn't work.  
Then tried ?trellis.device and noted that htere is a device argument  
as well as a color argument. This "works":

trellis.device(color=F, device="pdf")
pdf(file="test.pdf")
Depth <- equal.count(quakes$depth, number=8, overlap=.1)
xyplot(lat ~ long | Depth, data = quakes)
dev.off()

-- 
David.
>
> How I made to put color off in trellis device?
>
> Thanks
> Ronaldo
>
> -- 
> 2ª lei - Na pesquisa, o que importa é o que está correto,
>          e não quem está correto.
>
>       --Herman, I. P. 2007. Following the law. NATURE, Vol 445, p.  
> 228.
>
>> Prof. Ronaldo Reis Júnior
> |  .''`. UNIMONTES/DBG/Lab. Ecologia Comportamental e Computacional
> | : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
> | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
> |   `- Fone: (38) 3229-8192 | ronaldo.reis at unimontes.br
> | http://www.ppgcb.unimontes.br/lecc | LinuxUser#: 205366
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list