steve wrote: > In the following snippet > > plot(1:10,1:10,type="n") > points(1:5,1:5,pch="+") > points(6:10,6:10,pch=20) > legend(5,5, c("A","B"), pch=c("+",20)) > > I want to get a legend with a "+" and a solid circle (pch=20). > However, what I get in the legend is "+" and "2". How can I get a "+" > and a solid circle? > > Hmm... There seems to be no way around having all pch's of the same type, because it has to be a single vector. So what you need to do is to find the integer code for "+". This happens to be the same as its ASCII code which is 43. One slightly sneaky way of finding that out is
> as.integer(charToRaw("+")) [1] 43 -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ R-help@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.