[R] xyplot - I can't find colors in my picture

Grzesiek gregorio99 at gmail.com
Mon Aug 16 15:09:53 CEST 2010


Hi,
Anybody can tell me why I don't have colors in my picture? 

 
library(lattice)
my.pch<-c(17,16,15,18,20,9,10,12)
my.fill<-c('yellow','black','green','red','blue','cyan','magenta','pink')

wzorzec1<- c(1,3,2,4,6,4,2,3)
wzorzec2<- c(5,3,6,6,2,3,4,1)
a<-factor(wzorzec1)
b<-factor(wzorzec2)
n1<-c(11,22,33,22,5,22,33,24)
n2<-c(4,3,5,7,8,4,3,2)

		xyplot(n1~n2,	
				panel=function(x,y, ...,subscripts) {
					pch <- my.pch  [a[subscripts]]
					fill<- my.fill [b[subscripts]]
					panel.xyplot(x,y,pch=pch,
									fill=fill, col="black")
				},
				key=list(space='right',adj=1,
					text=list(levels(a)),
					points=list(pch=my.pch),
					text=list(levels(b)),
					points=list(pch=21,fill=my.fill),
					rep=FALSE))
					

-- 
View this message in context: http://r.789695.n4.nabble.com/xyplot-I-can-t-find-colors-in-my-picture-tp2326848p2326848.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list