I have a dataset of three columns and n number of rows. column 1 contains the name, value of column 2, and the value of column 3 (rank2).
I want to plot a scatter plot with outlier values displaying names.
The commands RI use are as follows:
tiff('scatterplot.tiff')
data<-read.table("scatterplot_data", header=T)
attach(data)
reg1<-lm(A~B)
plot(A,B,col="red")
abline(reg1)
outliers<-data[which(2^(data[,2]-data[,3]) >= 4 | 2^(data[,2]-data[,3]) <=0.25),]
text(outliers[,2], outliers[,3],labels=outliers[,1],cex=0.50)
dev.off()
and I get this figure: 
I want the labels on the bottom half to be the same color, and the labels in the top half to have a different color, like green and red.
Any suggestions or settings in the teams?
source
share