Colour points in a plot differently depending on a vector of values

前端 未结 3 699
借酒劲吻你
借酒劲吻你 2020-11-28 20:05

I\'m plotting the plot below using R\'s plot function. It is a plot of a vector \'shiftTime\' of shift in time. I have another vector \'intensity\' of the intensity values r

3条回答
  •  自闭症患者
    2020-11-28 20:46

    To add a legend to joran's answer in base R:

    legend("topleft",title="Decile",legend=c(1:10),col =rbPal(10),pch=20)
    

    This example adds ",cex=0.8" just for prettiness:

提交回复
热议问题