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
.
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"), ...)
A numerical variable to be plotted using a color scale
A matrix or data.frame
with two columns, or an object inheriting from SpatialPoints
, of the same length as x
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., terrain.colors(64)
),
or as the name of one of nodiv's internal palettes. Possibillities are "parula", "jet", "blackbody", "HMblueyellow", "HMrainbow",
"HMlinear_optimal", "HMoptimal_scale", "cube1", "cubeyf1"
. Alternatively col
can be one of "auto", "ramp", "monochrome", "divergent" or "individual"
, allowing nodiv
to choose a palette of the given type
A shape file giving a map to use as a background for the plot
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
If shape is a polygon, the color to use for plotting the line border
The values to use for the extremes of the color scale
Given a shapefile, the function will set the outer limits of the plot to the bounding box of the shapefile. If zoom_to_points
is TRUE
, the outer limits will be set by the bounding box of the data points instead.
The point character to use for plotting points
The central color of points when using a pch value between 21 and 25
An object of type distrib_data
, nodiv_data
or nodiv_result
to use for plotting x.
Whether to plot a color legend
The number or name of the species to be plotted
If specified, plots the sampling grid cell borders in this color
If specified, set the line width of overlaid grid cell borders
If specified, which grid cells to draw cell borders around
Whether to overlay the shape file border on top of the points - only works if shape is a vector shapefile
Specifies whether to define the colors on an equal interval or a quantile-based color scale
Specifies custom labels for the colorbar legend
Additional arguments to pass to plot
Michael Krabbe Borregaard
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.