Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mapplot

Wrapper function to plot maps of different classes


Description

This function plots Raster and sp-type objects.

Usage

mapplot(x, ...)

## S4 method for signature 'RasterLayer'
mapplot(
  x,
  col = "gradinv",
  axes = FALSE,
  box = FALSE,
  legend = FALSE,
  legend.title = NULL,
  ...
)

## S4 method for signature 'RasterStack'
mapplot(x, col = gradinv(255), ...)

## S4 method for signature 'RasterArray'
mapplot(
  x,
  col = "gradinv",
  rgb = FALSE,
  legend = FALSE,
  axes = FALSE,
  box = FALSE,
  ncol = 3,
  legend.title = NULL,
  plot.title = NULL,
  rowlabels = rownames(x),
  multi = FALSE,
  ask = FALSE,
  ...
)

## S4 method for signature 'SpatialPolygonsDataFrame'
mapplot(x, col = "lightgrey", ...)

## S4 method for signature 'SpatialPolygons'
mapplot(x, col = "lightgrey", ...)

Arguments

x

Object to be plotted

...

arguments passed to class-specific methods.

col

(character) Color or color scheme of the plot. See ramps for available palettes (ipccLine and ipccRCP are not available).

axes

(logical) Should axes be displayed?

box

(logical) Should bounding boxes be displayed?

legend

(logical) Triggers whether the legend of a RasterLayer would be plotted.

legend.title

(character) Title for the legend, if legend = TRUE.

rgb

set to (TRUE) to make a red-green-blue plot based on three layers or bands.

ncol

numeric) Set number of columns in a multi-plot for a single variable. For a RasterArray with multiple variables, this number is automatically set to the number of variables.

plot.title

(character) The title for each individual plot. Only available for a single variable at the moment.

rowlabels

(character) label for each row of the overall plot. Uses the rownames of the RasterArray by default. Only availble for multivariate RasterArrays.

multi

(logical) Should the plots be printed on multiple pages?

ask

(logical or NULL) If multi.page = TRUE and ask = TRUE, then the user will be prompted before a new page of output is started

Value

None.

Examples

#single variable
	data(dems)
	mapplot(dems, ncol=4)

chronosphere

Earth System History Variables

v0.4.1
CC BY 4.0
Authors
Adam T. Kocsis, Nussaibah B. Raja
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.