Last data update: 2014.03.03

R: Add Arrows to a Plot Using Relative (0:1) Coordinates
addArrowsR Documentation

Add Arrows to a Plot Using Relative (0:1) Coordinates

Description

Call the arrows function using relative (0:1) coordinates.

Usage

addArrows(x1, y1, x2, y2, ...)

Arguments

x1

x-coordinate (0:1) at base of arrow.

y1

y-coordinate (0:1) at base of arrow.

x2

x-coordinate (0:1) at tip of arrow.

y2

y-coordinate (0:1) at tip of arrow.

...

additional parameters for the function arrows.

Details

Lines will be drawn from (x1[i],y1[i]) to (x2[i],y2[i])

Author(s)

Jon T. Schnute, Pacific Biological Station, Fisheries and Oceans Canada , Nanaimo BC

See Also

addLabel, addLegend

Examples

local(envir=.PBSmodEnv,expr={
  oldpar = par(no.readonly=TRUE)
  tt=seq(from=-5,to=5,by=0.01)
  plot(sin(tt), cos(tt)*(1-sin(tt)), type="l")
  addArrows(0.2,0.5,0.8,0.5)
  addArrows(0.8,0.95,0.95,0.55, col="#FF0066")
  par(oldpar)
})

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PBSmodelling)
Error in library(PBSmodelling) : 
  there is no package called 'PBSmodelling'
Execution halted