plot_points {nodiv} | R Documentation |
Plot a variable on spatial points or a spatial grid using a color scale.
Description
Plots a variable either as colored points or as a colored raster. plot_sitestat
is a wrapper function that dispatches the other functions according to the type
of distrib_data
.
Usage
plot_points(x, coords, col, shape = NULL,
shapefill = "grey", zlim= NULL, zoom_to_points = FALSE,
pch = 16, bg = par("bg"), legend = TRUE, ...)
plot_grid(x, coords, col, shape = NULL,
shapefill = "grey", shapeborder = NA, zlim = NULL,
zoom_to_points = FALSE, legend = TRUE, gridcol, gridlwd,
gridsites, overlay_shape = FALSE,
colscale = c("equal_interval","quantiles"), legendlabels = NULL, ...)
plot_species(distrib_data, species, col = c("darkgreen", "red"), ...)
Arguments
x |
A numerical variable to be plotted using a color scale |
coords |
A matrix or |
col |
The color palette to use for the color scale. Can be given as color names, a vector of hex colors from a call to a color palette (e.g., |
shape |
A shape file giving a map to use as a background for the plot |
shapefill |
If shape is a polygon, the color to use to fill the polygons. If shape is a line shapefile, the color to use for plotting lines |
shapeborder |
If shape is a polygon, the color to use for plotting the line border |
zlim |
The values to use for the extremes of the color scale |
zoom_to_points |
Given a shapefile, the function will set the outer limits of the plot to the bounding box of the shapefile. If |
pch |
The point character to use for plotting points |
bg |
The central color of points when using a pch value between 21 and 25 |
distrib_data |
An object of type |
legend |
Whether to plot a color legend |
species |
The number or name of the species to be plotted |
gridcol |
If specified, plots the sampling grid cell borders in this color |
gridlwd |
If specified, set the line width of overlaid grid cell borders |
gridsites |
If specified, which grid cells to draw cell borders around |
overlay_shape |
Whether to overlay the shape file border on top of the points - only works if shape is a vector shapefile |
colscale |
Specifies whether to define the colors on an equal interval or a quantile-based color scale |
legendlabels |
Specifies custom labels for the colorbar legend |
... |
Additional arguments to pass to plot |
Details
Note that if shape
is a raster
object, the points may shift relative to the background when resizing the image. This seems to be due to a bug in the raster
package.
Author(s)
Michael Krabbe Borregaard