labelLine: Label a Line Segment

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Label a Line Segment

Usage

1
2
3
labelLine(P1, P2, above = TRUE, dinch = 0.2, lab = "text",
 acode = 3, alength = 0.06, aty = 1, acol = "black", bty = 1,
 bcol = "black", tcol = "black", font = 1, cex = 1)

Arguments

P1

Point 1 c(x,y)

P2

Point 2 c(x,y)

above

logical, TRUE=label above the line, else below

dinch

length the legs

lab

character, text label

acode

code for arrows, see arrows

alength

length for arrows

aty

lty for arrows

acol

color for arrows

bty

style for legs

bcol

color for legs

tcol

color for text

font

font for text

cex

character expansion for text, see par

Details

Two short lines are drawn perpendicular to the line between the points, the length of this line is dinch. The arrow is drawn between the legs, using the parameters provided.

Value

graphical side effects

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

par, arrows, text

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 V1 = c(runif(1) ,  runif(1),runif(1) , runif(1))

  
 P1 = c(V1[1], V1[3])
P2 =  c(V1[2], V1[4])
 plot(c(P1[1], P2[1]), c(P1[2], P2[2] ), asp=1, type='n' )
   arrows(P1[1], P1[2], P2[1], P2[2], length=.04, col='red')
    
   labelLine( P1, P2 , lab="ABOVE", dinch = .5,
           aty=2, acol='blue'  )
   labelLine( P1, P2 , above=FALSE, lab="below",
         dinch = .5, aty=2, acol='green', tcol="magenta"  )


 

geophys documentation built on May 1, 2019, 9:26 p.m.