| plot | R Documentation |
trigrid, hexagrid or facelayer classesThis function will invoke the plot method of the sf or the SpatialPolygons class.
The function passes arguments to the plot method of the SpatialPolygons class. In case a heatmap is plotted and the plotting device gets resized,
some misalignments can happen. If you want to use a differently sized window, use x11 to set the height and width before running the function.
The function matches data referred to the grid and plots it with sf's plotting methods.
plot
## S4 method for signature 'trigrid,ANY'
plot(x, crs = NULL, ...)
## S4 method for signature 'facelayer,ANY'
plot(
x,
crs = NULL,
col = "heat",
border = NA,
alpha = NULL,
frame = FALSE,
legend = TRUE,
breaks = NULL,
inclusive = TRUE,
discrete = FALSE,
...
)
## S4 method for signature 'trigrid,numeric'
plot(x, y, crs = NULL, main = "", ...)
## S4 method for signature 'trigrid,array'
plot(x, y, crs = NULL, main = "", ...)
## S4 method for signature 'trigrid,table'
plot(x, y, crs = NULL, main = "", ...)
## S4 method for signature 'trigrid,character'
plot(x, y, crs = NULL, main = "", ...)
## S4 method for signature 'trigrid,logical'
plot(x, y, crs = NULL, main = "", ...)
x |
( |
crs |
( |
... |
Arguments passed to the |
col |
( |
border |
( |
alpha |
( |
frame |
( |
legend |
( |
breaks |
( |
inclusive |
( |
discrete |
( |
y |
Data or part of the grid to be plotted. If it is an unnamed character vector, then it is expected to be
a set of faces, which will be treated as a subscript that indicates the faces to be plotted.
If it is a logical vector, then it is expeced to be subscript, indicating a similar operation.
If it is a named logical or character vector, table with names, or single-dimensional named array
then the names are expected to refer to faces of the grid |
main |
The main title of the plot |
An object of class standardGeneric of length 1.
The function has no return value.
# A simple grid, with sf-representation
gr <- hexagrid(4, sf=TRUE)
dat <- 1:nrow(gr@faces)
names(dat) <- paste0("F", dat)
plot(x=gr, y=dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.