[R] add only selected labels using thigmophobe

David Winsemius dwinsemius at comcast.net
Sun Jun 13 18:09:34 CEST 2010



 
joerg wrote:
> 
> I am trying to label data points within a scatter plot using thigmophobe. 
> While the data set consists of about 3000 points I only would like to
> label a subset of these points. 
> 
> I read the x and y coordinates in from a txt file and define them as:
> 
>  MLPM1<-log2(Ratio.M.L.G2.PM)
>  HLG2<-log2(Ratio.H.L..G2.PM)
> 
> the names and a corresponding ID are read in from the same txt file as:
> 
> GENE<-(Gene.Names)
> ID<-(id)
> 
> plotting is:
> 
> plot(x=MLPM1,y=HLG2,main='G2 vs PM',xlab='Fold change M/L PM',ylab='Fold
> change H/L G2)',xlim=c(-7,7),ylim=c(-7,7))
> 
> labelling of the whole dataset I can do with:
> 
> thigmophobe.labels(MLPM1,HLG2,labels=c(GENE),col=c(2:6,8:12),font=2) 
> 
> but how can I label only a few points from the whole dataset with names or
> IDs ?? 
> 
> 

 require(plotrix)
#Loading required package: plotrix
 ?thigmophobe.labels
#starting httpd help server ... done
 dta <- data.frame(a=rlnorm(20), b=rlnorm(20))
 with( dta, plot(a,b))
 with( dta[c(2,7,10), ], thigmophobe.labels(a, b, labels=c('A', 'B', 'C') )
)

-- 
David.

-- 
View this message in context: http://r.789695.n4.nabble.com/add-only-selected-labels-using-thigmophobe-tp2253497p2253549.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list