Learn R Programming

Maeswrap (version 1.4.11)

addarrow: Adds an arrow to a plot

Description

Specify the length and rotation (bearing) of the arrow, and it will be added to the current device. Works for 3D and 2D plots. Different from arrows, where begin and endpoints of the arrow need to be specified.

Usage

addarrow(x0,y0,len,bearing,headlen=0.2*len,
headangle=25,Nlabel=TRUE,addto=c('rgl','plot','lattice'),...)

Arguments

x0,y0
Begin point coordinates.
len
Length of arrow.
bearing
Direction. See Details.
headlen
Length of arrow head.
headangle
(Half)-Angle of arrow head.
Nlabel
Logical. Add a label 'N' or not.
addto
One of 'rgl', 'plot', or 'lattice', or first letters.
...
Further parameters passed to segments.

Value

  • Adds to the current device. Returns error when no device is open.

Details

This function is used to add an arrow pointing North on a plot made with Plotstand, or plotuspar. The bearing is defined as in MAESTRA, where 0 means the X axis points south (and the North arrow thus parallel to the X-axis), with 90 degrees the X axis points West, and so forth. Because I don't know how to tell if the current device is setup by either rgl, Lattice, or the base graphics plot, the user needs to specify what device to add the arrow to. The default is 'rgl'.