View source: R/plot_variable.R
plot_variable | R Documentation |
plot_variable
plots a map and fills in regions with colors to represent intensity in an areal-interpretion of model results
If maps are generating visual artefacts, please try using argument country
to simplify the polygons used to represent land features.
In some sampling designs and/or analyses, it is not appropriate to extrapolate beyond samping stations. In these cases,
the analyst may define the extrapolation-grid to only represent sampling stations, and then use format="points"
to restrict mapping to bullets at those locations.
plot_variable(
Y_gt,
map_list = NULL,
panel_labels = NULL,
projargs = "+proj=longlat",
map_resolution = "medium",
file_name = "density",
working_dir = getwd(),
Format = "png",
Res = 200,
add = FALSE,
outermargintext = c("Eastings", "Northings"),
zlim = NULL,
col = viridisLite::viridis,
mar = c(0, 0, 2, 0),
oma = c(4, 4, 0, 0),
legend_x = c(0, 0.05),
legend_y = c(0.05, 0.45),
cex.legend = 1,
mfrow = NULL,
land_color = "grey",
n_cells = NULL,
xlim = NULL,
ylim = NULL,
country = NULL,
contour_nlevels = 0,
fun = mean,
format = "sf",
cex.points = 1,
legend_digits = 1,
...
)
Y_gt |
matrix where values for every column are plotted as a map in a panel-figure with one panel per column |
map_list |
output from |
panel_labels |
vector defining titles to use for each panel; defaults to blank |
projargs |
Character passed to |
add |
boolean indicating whether to add plot to an existing panel figure, or to define a new panel figure |
outermargintext |
vector defining text to plot in outer margins of panel figure |
zlim |
two numeric values, specifying range for defining bounds of color scale.
If |
legend_x |
two numeric values (generally between 0 and 1, but slightly lower/higher values generate colorbars that are just outside the plotting window) giving left and right-hand location of color legend |
legend_y |
two numeric values (see description for legend_x) giving bottom and top location of color legend |
land_color |
color for filling in land (use |
n_cells |
Integer used to determine the argument |
country |
a character vector of country names. |
contour_nlevels |
number of levels used when adding contour lines, passed to |
fun |
function or character. To determine what values to assign to cells that are covered by multiple spatial features. You can use functions such as If You can also pass multiple functions using a statement like |
format |
Character specifying whether to plot maps as a raster (the default), |
cex.points |
Numeric specifying the size of bullets when |
legend_digits |
number of digits (i.e., value passed to |
... |
arguments passed to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.