R color scatter plot points based on values

后端 未结 4 1575
悲哀的现实
悲哀的现实 2020-11-28 08:03

I am able to plot a scatter plot and color the points based on one criteria, i.e. I can color all points >=3 as red and the remainder as black. I would love to be able to co

4条回答
  •  醉梦人生
    2020-11-28 08:47

    Also it'd work to just specify ifelse() twice:

    plot(pos,cn, col= ifelse(cn >= 3, "red", ifelse(cn <= 1,"blue", "black")), ylim = c(0, 10))
    

提交回复
热议问题