addArrowMark: Add arrow mark to the figure at a given position

Description Usage Arguments Value See Also Examples

View source: R/addArrowMark.R

Description

A function to add arrow mark for emphasizing peaks

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
addArrowMark(
  pos = grid.locator(),
  label = NULL,
  angle = 15,
  length = unit(0.25, "inches"),
  col = "red",
  cex = 1,
  quadrant = 4,
  type = "closed",
  vp = NULL
)

Arguments

pos

A unit object representing the location of arrow mark to be placed at current viewport. Default is the value of grid.locator, which will get the location of the mouse click.

label

A character or expression vector.

angle

A parameter passed into grid::arrow function. The angle of arrow head in degrees (smaller numbers produce narrower, pointier arrows). Essentially describes the width of the arrow head.

length

A parameter passed into grid::arrow function. Aunit specifying the length of the arrow head.

col

color of the arrow

cex

Multiplier applied to fontsize

quadrant

the direction of arrow, 1: to bottomleft, 2: to bottomright, 3: to topright, 4: to topleft

type

A parameter passed into grid::arrow function. One of "open" or "closed" indicating whether the arrow head should be a closed triangle.

vp

A Grid viewport object. It must be output of viewTracks

Value

invisible x, y position value.

See Also

See Also as addGuideLine, arrow

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
grid.newpage()
addArrowMark(list(x=unit(.5, "npc"), 
               y=unit(.5, "npc")), 
               label="label1",
               col="blue")
##  how to get the position by mouse click
if(interactive()){
pos <- addArrowMark(label="byClick")
addArrowMark(pos, label="samePosAsAbove")
}

trackViewer documentation built on Feb. 11, 2021, 2 a.m.