Creates a tmap-element
that draws coordinate grid lines. It serves as a layer that can be drawn anywhere between other layers. By default the coordinate system of the (master) shape object is used, which results in horizontal and vertical lines. Alternatively, grid lines can be reprojected, for instance to latitude longitude coordinates, and hence be curved.
tm_grid(x = NA, y = NA, n.x = NA, n.y = NA, projection = NA,
col = NA, lwd = 1, alpha = NA, labels.size = 0.6, labels.col = NA,
labels.margin.x = 0, labels.margin.y = 0, labels.inside.frame = TRUE)
x coordinates for vertical grid lines. If NA
, it is specified with a pretty scale and n.x
.
y coordinates for horizontal grid lines. If NA
, it is specified with a pretty scale and n.y
.
prefered number of grid lines for the x axis.
prefered number of grid lines for the y axis.
projection character. If specified, the grid lines are projected accordingly. See set_projection
for projection details. Many world maps are projected, but still have latitude longitude ("longlat"
) grid lines.
color of the grid lines.
line width of the grid lines
alpha transparency of the grid lines. Number between 0 and 1. By default, the alpha transparency of col
is taken.
font size of the tick labels
font color of the tick labels
margin between tick labels of x axis and the frame
margin between tick labels of y axis and the frame
Show labels inside the frame?