I am using the code as given below
The problem is there is very long space between legend line and legend text as shown in figure. kindly help how i can reduce this spacing. such as spacing between legend numbers and lines like this
________          1
--------          2
legend(x=q-70, y=m, bty = "n", 
  legend = c("1","2","3", "4","5", "6","7", "8","9", "10","11", "12","13", "14","15", "16","17", "18","19", "20"), 
  lty = c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,4,4,4,4), 
  col = c("black", "red","green","blue","cyan","magenta","yellow","gray","black", "red","green","blue","cyan","magenta","yellow","gray","black", "red","green","blue"),  
  y.intersp=0.7, cex = 0.95,seg.len = 1.3, lwd = 2)

 
    
