[R] xyplot - I can't find colors in my picture
Chris Campbell
ccampbell at mango-solutions.com
Mon Aug 16 16:01:18 CEST 2010
Dear Grzesiek
Only pch 21 to 25 can be filled. Pairing fill with plot characters 1:20
will be ignored. You could try overlaying points to increase the number
of unique colour/shape combinations.
Cheers
Chris
Hadley Wickham, Creator of ggplot2 - teaching in the UK. 1st - 2nd
November 2010.
To book your seat please go to http://mango-solutions.com/news.html
Chris Campbell, PhD
MANGOSOLUTIONS
T: +44 (0)1249 767700 Ext: 233
F: +44 (0)1249 767707
M: +44 (0)7967 028876
www.mango-solutions.com
Unit 2 Greenways Business Park
Bellinger Close
Chippenham
Wilts
SN15 1BN
UK
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Grzesiek
Sent: 16 August 2010 14:10
To: r-help at r-project.org
Subject: [R] xyplot - I can't find colors in my picture
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-t
p2326848p2326848.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
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.
LEGAL NOTICE
This message is intended for the use o...{{dropped:9}}
More information about the R-help
mailing list