Learn R Programming

RFOC (version 3.4-10)

fancyarrows: Make fancy arrows

Description

Create and plot fancy arrows. Aspect ratio must be set to 1-1 for these arrows to plot correctly.

Usage

fancyarrows(x1, y1, x2, y2, thick = 0.08,
     headlength = 0.4, headthick = 0.2, col = grey(0.5),
     border = "black")

Value

Graphical side effects.

Arguments

x1

x tail coordinate

y1

y tail coordinate

x2

x head coordinate

y2

y head coordinate

thick

thickness of arrow

headlength

length of head

headthick

thickness of head

col

fill color

border

color of border

Author

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

See Also

TEACHFOC

Examples

Run this code
   thick = 0.01; headlength = 0.2; headthick = 0.1

x = runif(10, -1, 1)
y = runif(10, -1, 1)

############   MUST set asp=1 here
plot(x,y, asp=1)

fancyarrows(rep(0, 10) , rep(0, 10) ,x, y,
thick =thick , headlength =  headlength,
headthick =headthick)

Run the code above in your browser using DataLab