TOC_NI<-read.csv2("C:/Users/hilliges/Desktop/Master/Daten/Statistik/TOC-NI.csv", sep=";", dec=",", encoding="UTF-8") circ<-TOC_NI[order(TOC_NI$NI,decreasing=T),][1:4,] plot(NI~TOC,data=TOC_NI,col="blue", pch=16, xlim=c(0,4500000)) abline(lm(NI~TOC,data=TOC_NI),col = "red",lwd=3) points(NI~TOC,data=TOC_NI,col='red',pch=1,size=3) ## this line is coloring all points because you're using TOC_NI still
points(NI~TOC,data=circ,col='red',pch=1,size=3) ## now we're only plotting the four points in circ. sorry for the confusion. however, in the future please provide a reproducible data set along with your question so we can more easily help. Justin On Fri, Jan 20, 2012 at 5:49 AM, Geophagus <falk.hilli...@twain-systems.com>wrote: > Dear Petr and Justin, > my problem ist, that I only want to have the 4 highest values for "Ni" as a > red point or with a red circle. The other points should not be modificated. > In your proposals always all points get a red circle or a red point not > only > the 4 highest Ni values! > I hope you could understand me! > Thanks for your help! > GeO > > > -- > View this message in context: > http://r.789695.n4.nabble.com/colored-outliers-tp4282207p4313278.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.