Skip to content
Prev 263382 / 398502 Next

How to add label to lines()

On Jun 21, 2011, at 10:31 AM, Nevil Amos wrote:

            
Without an example it is difficult to know if your coding is  
efficient. The text fn is vectorized, so there may be a one-liner that  
does what you could be currently doing piecemeal.

plot(1,1)
  for( b in 1-(1:5)/20) abline(a=0,b=b)
  text(1.4, 1.4*(1-(1:5)/20), as.character(1-(1:5)/20) )