Plot method for the trigrid
, hexagrid
or facelayer
classes
Source: R/plot-2d-grid.R
, R/plot-2d-data.R
plot.Rd
This 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.
Usage
plot
# S4 method for trigrid,ANY
plot(x, crs = NULL, ...)
# S4 method for 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 trigrid,numeric
plot(x, y, crs = NULL, main = "", ...)
# S4 method for trigrid,array
plot(x, y, crs = NULL, main = "", ...)
# S4 method for trigrid,table
plot(x, y, crs = NULL, main = "", ...)
# S4 method for trigrid,character
plot(x, y, crs = NULL, main = "", ...)
# S4 method for trigrid,logical
plot(x, y, crs = NULL, main = "", ...)
Arguments
- x
- crs
(
character
orcrs
) A coordinate system for the transformation of coordinates.- ...
Arguments passed to the
plot
function.- col
(
character
) Colors passed to acolorRamp
in case of thefacelayer
containslogical
values, a single value is required (defaults to"red"
).- border
(
character
) Specifies the color of the borders of the cells.- alpha
(
character
) Two digits for the fill colors, in hexadecimal value between0
and255
.- frame
(
logical
) IfTRUE
the grid boundaries will be drawn with black.- legend
(
logical
): Should the legend be plotted?- breaks
(
numeric
) The number of breakpoints between the plotted levels. The argument is passed to thecut
function.- inclusive
(
logical
): If there are values beyond the limits of breaks, should these be represented in the plot (TRUE
) or left out completelyFALSE
?- discrete
(
logical
): Do the heatmaps symbolize a discrete or a continuous variable? This argument only affects the legend of the heatmap.- 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
x
. The default sf-based plotting method will apply to the data type.- main
The main title of the plot