addGrid | R Documentation |
This function adds a grid to an existing plot (like box()
). User can
specify coordinates on x- and/or y-axis where to draw vertical and/or
horizontal lines respectively. User can also color the background of the plot
area and add a box around this area (if required).
addGrid( at_x, at_y, col = NA, border = "black", lwd = 1, lty = 1, box = FALSE, ... )
at_x, at_y |
coordinates on the x and y-axis where to draw lines. |
col |
the color of the background. |
border |
the color of lines (and box). |
lwd |
the width of lines (see |
lty |
the type of lines (see |
box |
a boolean. If |
... |
other graphical parameters as in |
If user does not specify at_x
and at_y
, the grid is aligned with the tick
marks on the corresponding default axes (computed by axTicks
).
Nicolas CASAJUS, nicolas.casajus@gmail.com
maps::map() addGrid() addGrid(box = TRUE) addGrid(col = "#ff000044", border = "green", box = TRUE) maps::map() addGrid(at_x = axTicks(1), border = "blue", lwd = 2) addGrid(at_y = axTicks(2), border = "red") addGrid(at_x = NULL, at_y = NULL, lwd = 3, box = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.