Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addPoints

Add EventData/PolyData to an Existing Plot as Points


Description

Add EventData/PolyData to an existing plot, where each unique EID describes a point.

Usage

addPoints (data, xlim = NULL, ylim = NULL, polyProps = NULL,
           cex = NULL, col = NULL, pch = NULL, ...)

Arguments

data

EventData or PolyData to add (required).

xlim

range of X-coordinates.

ylim

range of Y-coordinates.

polyProps

PolyData specifying which points to plot and their properties. par parameters passed as direct arguments supersede these data.

cex

vector describing character expansion factors (cycled by EID or PID).

col

vector describing colours (cycled by EID or PID).

pch

vector describing plotting characters (cycled by EID or PID).

...

additional par parameters for the points function.

Details

This function clips data to xlim and ylim before plotting. It only adds PolyData containing X and Y columns.

For additional help on the arguments cex, col, and pch, please see par.

Value

PolyData consisting of the PolyProps used to create the plot.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

Examples

local(envir=.PBSmapEnv,expr={
  oldpar = par(no.readonly=TRUE)
  #--- load the data (if using R)
  if (!is.null(version$language) && (version$language=="R"))
    data(nepacLL,surveyData,envir=.PBSmapEnv)
  #--- plot a map
  plotMap(nepacLL, xlim=c(-136, -125), ylim=c(48, 57))
  #--- add events
  addPoints(surveyData, col=1:7)
  par(oldpar)
})

PBSmapping

Mapping Fisheries Data and Spatial Analysis Tools

v2.73.0
GPL (>= 2)
Authors
Jon T. Schnute [aut], Nicholas Boers [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [ctb], Denis Chabot [ctb], Chris Grandin [ctb], Angus Johnson [ctb], Paul Wessel [ctb], Franklin Antonio [ctb], Nicholas J. Lewin-Koh [ctb], Roger Bivand [ctb]
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.