-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathmapGrid.Rd
126 lines (114 loc) · 3.82 KB
/
mapGrid.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/map.R
\name{mapGrid}
\alias{mapGrid}
\title{Add a Longitude and Latitude Grid to an Existing Map}
\usage{
mapGrid(
dlongitude = 15,
dlatitude = 15,
longitude,
latitude,
col = "darkgray",
lty = "solid",
lwd = 0.5 * par("lwd"),
polarCircle = 0,
longitudelim,
latitudelim,
debug = getOption("oceDebug")
)
}
\arguments{
\item{dlongitude}{increment in longitude, ignored if \code{longitude}
is supplied, but otherwise determines the longitude sequence.}
\item{dlatitude}{increment in latitude, ignored if \code{latitude}
is supplied, but otherwise determines the latitude sequence.}
\item{longitude}{numeric vector of longitudes, or \code{NULL} to prevent drawing
longitude lines.}
\item{latitude}{numeric vector of latitudes, or \code{NULL} to prevent drawing
latitude lines.}
\item{col}{color of lines}
\item{lty}{line type}
\item{lwd}{line width}
\item{polarCircle}{a number indicating the number of degrees of latitude
extending from the poles, within which zones are not drawn.}
\item{longitudelim}{optional argument specifying suggested longitude limits
for the grid. If this is not supplied, grid lines are drawn for the
whole globe, which can yield excessively slow drawing speeds for
small-region plots. This, and \code{latitudelim}, are both set by
\code{\link[=mapPlot]{mapPlot()}} if the arguments of the same name are passed to
that function.}
\item{latitudelim}{similar to \code{longitudelim}.}
\item{debug}{a flag that turns on debugging. Set to 1 to get a moderate
amount of debugging information, 2 to go two function levels deep, or
3 to go all the way to the core functions. Any value above 3 will be
truncated to 3.}
}
\value{
A \link{data.frame}, returned silently, containing
\code{"side"}, \code{"value"}, \code{"type"}, and \code{"at"}.
A default call to \code{\link[=mapPlot]{mapPlot()}} ensures agreement of grid and axes by using
this return value in a call to \code{\link[=mapAxis]{mapAxis()}}.
}
\description{
Plot longitude and latitude grid on an existing map. This is an
advanced function, requiring coordination with \code{\link[=mapPlot]{mapPlot()}} and
(possibly) also with \code{\link[=mapAxis]{mapAxis()}}, and so it is best avoided by
novices, who may be satisfied with the defaults used by
\code{\link[=mapPlot]{mapPlot()}}.
}
\details{
This is somewhat analogous to \code{\link[=grid]{grid()}}, except that the first two
arguments of the latter supply the number of lines in the grid,
whereas the present function has increments for the first two
arguments.
}
\examples{
\donttest{
if (utils::packageVersion("sf") != "0.9.8") {
# sf version 0.9-8 has a problem with this projection
library(oce)
data(coastlineWorld)
par(mar = c(2, 2, 1, 1))
# In mapPlot() call, note axes and grid args, to
# prevent over-plotting of defaults.
mapPlot(coastlineWorld,
type = "l", projection = "+proj=ortho",
axes = FALSE, grid = FALSE
)
mapGrid(15, 15)
}
}
}
\seealso{
A map must first have been created with \code{\link[=mapPlot]{mapPlot()}}.
Other functions related to maps:
\code{\link{formatPosition}()},
\code{\link{lonlat2map}()},
\code{\link{lonlat2utm}()},
\code{\link{map2lonlat}()},
\code{\link{mapArrows}()},
\code{\link{mapAxis}()},
\code{\link{mapContour}()},
\code{\link{mapCoordinateSystem}()},
\code{\link{mapDirectionField}()},
\code{\link{mapImage}()},
\code{\link{mapLines}()},
\code{\link{mapLocator}()},
\code{\link{mapLongitudeLatitudeXY}()},
\code{\link{mapPlot}()},
\code{\link{mapPoints}()},
\code{\link{mapPolygon}()},
\code{\link{mapScalebar}()},
\code{\link{mapText}()},
\code{\link{mapTissot}()},
\code{\link{oceCRS}()},
\code{\link{oceProject}()},
\code{\link{shiftLongitude}()},
\code{\link{usrLonLat}()},
\code{\link{utm2lonlat}()}
}
\author{
Dan Kelley
}
\concept{functions related to maps}