-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
\name{add_grid} | ||
|
||
\alias{add_grid} | ||
|
||
\title{add a grid to an existing terra plot} | ||
|
||
\description{ | ||
Wrapper around \code{\link[graphics]{grid}} that allows adding a grid to a map. This function will place the legend in the locations within the mapped area as delineated by the axes. | ||
|
||
Also see \code{\link{graticule}} | ||
} | ||
|
||
\usage{ | ||
add_grid(nx = NULL, ny = nx, col = "lightgray", lty = "dotted", | ||
lwd = par("lwd"), equilogs = TRUE) | ||
} | ||
|
||
\arguments{ | ||
\item{nx, ny}{number of cells of the grid in x and y direction. When NULL, as per default, the grid aligns with the tick marks on the corresponding default axis (i.e., tickmarks as computed by axTicks). When NA, no grid lines are drawn in the corresponding direction} | ||
\item{col}{character or (integer) numeric; color of the grid lines} | ||
\item{lty}{character or (integer) numeric; line type of the grid lines} | ||
\item{lwd}{non-negative numeric giving line width of the grid lines} | ||
\item{equilogs}{logical, only used when log coordinates and alignment with the axis tick marks are active. Setting equilogs = FALSE in that case gives non equidistant tick aligned grid lines} | ||
} | ||
|
||
\seealso{\code{\link{add_box}}, \code{\link{add_grid}}, \code{\link{graticule}} | ||
|
||
\examples{ | ||
v <- vect(system.file("ex/lux.shp", package="terra")) | ||
plot(v) | ||
add_grid() | ||
} | ||
|
||
\keyword{methods} | ||
\keyword{spatial} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters