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
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: