Skip to content

controlling colour in Trellis histogram

5 messages · Bill Shipley, Chuck Cleland, Deepayan Sarkar +1 more

#
Does this help?

mydata <- data.frame(OPTIMISM = 
c(29,35,26,22,30,37,29,32,25,35,38,33,41,28,40),
                      PARENTS = rep(c("Both Deceased", "One Deceased", 
"Both Alive"), c(4,5,6)))

library(lattice)

trellis.device(width=7, height=5, new = FALSE, col = FALSE, bg = "white")

histogram(~ OPTIMISM | PARENTS, data=mydata)
Bill Shipley wrote:

  
    
#
On Friday 01 October 2004 09:16, Bill Shipley wrote:
trellis.device(color = FALSE) 
## assuming you want the default device. 
## See ?trellis.device for more options

histogram(<...>)


Deepayan
#
Dear bill,

Try opening the Trellis graphics device with trellis.device(color=FALSE).

I hope this helps,
 John
Herbs","Mo
#
On Friday 01 October 2004 09:25, Chuck Cleland wrote:
The bg="white" is redundant if color=FALSE. 

Incidentally, if color=TRUE, setting bg="white" is IMO bad practice 
(although it seemed like a good idea at the time), since it creates 
settings with a white background while the other colors are only 
suitable for a dark background. To make it more difficult for users to 
achieve this, the 'bg' argument has been dropped from trellis.device in 
2.0.0.

Deepayan