[R] Why are there small circles in my plot

Mao Jianfeng jianfeng.mao at gmail.com
Wed Aug 19 09:10:54 CEST 2009


Dear R-listers,

There is my data and my codes to create a plot. I want to know why
there are two small circles in the upper right and lower left of the
plot respectively. Could you please share your experience or advice
with me?

# dummy data
factor<-rep(c("Alice","Jone","Mike"),each=100)
factor<-factor(factor)
traits<-c(rnorm(100, mean=1, sd=1), rnorm(100, mean=3, sd=3),
rnorm(100, mean=6, sd=6))
myda<-data.frame(factor,traits)

# my plot
plot(c(min(myda$traits),max(myda$traits)),c(-0.03,0.5), xlab='State',
ylab='ylab')
lines(density(myda$traits[factor==c("Alice")]), lwd=2,col=2)
lines(density(myda$traits[factor==c("Jone")]), lwd=2,col=3)
lines(density(myda$traits[factor==c("Mike")]), lwd=2,col=4)
points(myda$traits[factor==c("Alice")], rep(-0.01,
length(myda$traits[factor==c("Alice")])), pch="|", col=2)
points(myda$traits[factor==c("Jone")], rep(-0.02,
length(myda$traits[factor==c("Jone")])), pch="|", col=3)
points(myda$traits[factor==c("Mike")], rep(-0.03,
length(myda$traits[factor==c("Mike")])), pch="|", col=4)


Best Regards,

Yours,
Mao J-F




More information about the R-help mailing list