R- plot numbers instead of points -


i have made scatterplot, different symbols each data series. want make same scatterplot point show numbers. not value of each point, assigned number.

as of right now, have 3 depths plotting (0, 3, 6cm). have 0cm triangles, etc. want 0cm points character 0, 3cm points show 3, , 6cm points show 6.

is possible?

sure, pass pch parameter character.

dat <- data.frame(x=rnorm(100), y1=rnorm(100)-1, y2=rnorm(100), y3=rnorm(100)+1) plot(y1 ~ x, data=dat, pch="0", ylim=c(-4, 4)) points(y2 ~ x, data=dat, pch="3") points(y3 ~ x, data=dat, pch="6") 

eta: 1 nice thing pch parameter, many base graphics parameters, vectorised. can (which works agstudy's answer).

dat <- data.frame(x=rnorm(300), y=rnorm(300) + c(0,3,6), depth=rep(c(0,3,6), 100)) plot(x ~ y, data=dat, pch=as.character(dat$depth)) 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -