plotMap | R Documentation |
Plot a PolySet as a map, using the correct aspect ratio.
plotMap(polys, xlim = NULL, ylim = NULL, projection = TRUE,
plt = c(0.11, 0.98, 0.12, 0.88), polyProps = NULL,
border = NULL, lty = NULL, col = NULL, colHoles = NULL,
density = NA, angle = NULL, bg = 0, axes = TRUE,
tckLab = TRUE, tck = 0.014, tckMinor = 0.5 * tck, ...)
.plotMaps(polys, xlim, ylim, projection, plt, polyProps,
border, lty, col, colHoles, density, angle, bg,
axes, tckLab, tck, tckMinor, isType, ...)
.initPlotRegion(projection, xlim, ylim, plt)
polys |
|
xlim |
|
ylim |
|
projection |
|
plt |
|
polyProps |
|
border |
|
lty |
|
col |
|
colHoles |
|
density |
|
angle |
|
bg |
|
axes |
|
tckLab |
|
tck |
|
tckMinor |
|
... |
|
isType |
|
This function plots a PolySet, where each unique (PID
,
SID
) describes a polygon. It connects each polygon's last
vertex to its first. The function supports both borders
(border
, lty
) and fills (col
, density
,
angle
). When supplied with the appropriate arguments, it can
draw only borders or only fills . Unlike plotLines
and
plotPolys
, it uses the aspect ratio supplied in the
projection
attribute of polys
. If this attribute is
missing, it attempts to use its projection
argument. In the
absence of both, it uses a default aspect ratio of 1:1. It clips
polys
to xlim
and ylim
before plotting.
The function creates a blank plot when polys
equals
NULL
. In this case, the user must supply both xlim
and
ylim
arguments. Alternatively, it accepts the argument
type = "n"
as part of ..., which is equivalent to specifying
polys = NULL
, but requires a PolySet. In both cases,
the function's behaviour changes slightly. To resemble the
plot
function, it plots the border, labels, and other
parts according to par
parameters such as col
.
For additional help on the arguments border
, lty
,
col
, density
, and angle
, please see
polygon
and par
.
PolyData consisting of the PolyProp
s used to create the plot.
To satisfy the aspect ratio, this plotting routine resizes the plot
region. Consequently, par
parameters such as
plt
, mai
, and mar
will change. When the function
terminates, these changes persist to allow for additions to the plot.
Auxiliary dot function '.initPlotRegion'
initialises the plot region,
accounting for the aspect ratio.
Nicholas M. Boers, Software Engineer, Jobber, Edmonton AB
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-09-03
In package PBSmapping:
addLabels
,
addPolys
,
addStipples
,
clipPolys
,
closePolys
,
fixBound
,
fixPOS
,
locatePolys
,
plotLines
,
plotPoints
,
thinPolys
,
thickenPolys
.
local(envir=.PBSmapEnv,expr={
oldpar = par(no.readonly=TRUE)
#--- create a PolySet to plot
polys <- data.frame(PID=rep(1,4),POS=1:4,X=c(0,1,1,0),Y=c(0,0,1,1))
#--- plot the PolySet
plotMap(polys,xlim=c(-.5,1.5),ylim=c(-.5,1.5),density=0,projection=1)
par(oldpar)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.