rg_levelplot: Plot raster layers

Description Usage Arguments Examples

View source: R/levelplot.R

Description

This function is a wrapper around levelplot-methods with more convenient parameter names.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
rg_levelplot(
  raster,
  margin = FALSE,
  layout = NULL,
  palette = viridis::viridis(10),
  rev = F,
  classification.style = "pretty",
  nbreaks = 5,
  breaks = NULL,
  xlab = NULL,
  ylab = NULL,
  axis.labels.color = NULL,
  axis.labels.x.color = "black",
  axis.labels.y.color = "black",
  axis.labels.size = NULL,
  axis.labels.x.size = 1,
  axis.labels.y.size = 1,
  axis.labels.angle = NULL,
  axis.labels.x.angle = 0,
  axis.labels.y.angle = 0,
  axis.labels.font = NULL,
  axis.labels.x.font = "plain",
  axis.labels.y.font = "plain",
  axis.ticks = NULL,
  axis.ticks.x = F,
  axis.ticks.y = F,
  axis.line.col = "black",
  axis.line.type = 1,
  axis.line.width = 1,
  legend.labels = NULL,
  legend.label.position = NULL,
  legend.label.size = 1,
  legend.position = "left",
  legend.width = 1,
  legend.height = 1,
  legend.line.color = "black",
  legend.line.type = 1,
  legend.line.width = 1,
  legend.title = NULL,
  legend.title.size = 1,
  legend.title.font = 1,
  legend.title.col = "black",
  plot.background.col = "transparent",
  plot.title = NULL,
  plot.title.size = 1,
  plot.title.color = "black",
  strip.text = names(raster),
  strip.text.size = 1,
  strip.text.color = "black",
  strip.text.font = 1,
  strip.background.col = "transparent",
  strip.border.col = "transparent",
  ...
)

Arguments

raster

raster object that should be plotted. Can be a single raster layer or a stack/brick

margin

A list or a logical. If it is TRUE, two marginal graphics show the column (x) and row (y) summaries of the Raster* object. The summary is computed with the function mean. If it is a list, it contains parameters in ‘name=value’ form that define both margins, and may contain two other lists called ‘x’ and ‘y’ whose components affect the respective margins only.

layout

vector to specify number of columns and rows in the form c(ncol, nrow)

palette

string, the name of the palette or a function that returns color names such as RColorBrewer::brewer.pal(9, 'RdBu). If the name of the palette is given must be one of 'RdBu', 'BuRd', 'Magma', 'Viridis', 'Inferno'.

rev

logical, should the palette be reversed?

classification.style

string, style of the classification, one of "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", "dpih" or "headtails". See classIntervals. Only used when breaks = NULL

nbreaks

numeric, number of breaks. Only used when breaks = NULL

breaks

numeric, locations at which the colors change. Do not changes the legend labels, for this use legend.labels and legend.labels.position

xlab

string, Labels of the x axis. Supports also a vector of strings to draw multiple labels

ylab

string, Labels of the y axis. Supports also a vector of strings to draw multiple labels

axis.labels.color

string, color of the axis labels. Changes both x and y labels

axis.labels.x.color

string, color of the x labels

axis.labels.y.color

string, color of the y labels

axis.labels.size

numeric, size of the axis labels. Changes both x and y labels

axis.labels.x.size

numeric, size of the x labels

axis.labels.y.size

numeric, size of the y labels

axis.labels.angle

numeric, angle of the axis labels. Changes both x and y labels

axis.labels.x.angle

numeric, angle of the x labels

axis.labels.y.angle

numeric, angle of the y labels

axis.labels.font

string, fontface of the axis labels. Changes both x and y labels

axis.labels.x.font

string, fontface of x labels

axis.labels.y.font

string, fontface of y labels

axis.ticks

logical, should x and y axis ticks be displayed?

axis.ticks.x

logical, should x axis ticks be displayed?

axis.ticks.y

logical, should y axis ticks be displayed?

axis.line.col

string, color of the box around the plot

axis.line.type

numeric, linetype of the box around the plot

axis.line.width

numeric, linewidth of the box arourn the plot

legend.labels

string or numeric, the labels at the side of the legend. Set to legend.labels = breaks to have the same labels as breaks

legend.label.position

numeric, the position of the legend labels along the legend. Set to legend.label.position = breaks to have the same positions as specified in breaks

legend.label.size

numeric, size of the legend labels

legend.position

string, position of the legend. One of 'top', 'right', 'bottom' or 'left'. Legend.title seems not to work with legend.position = 'right'

legend.width

numeric, width of the legend

legend.height

numeric, height of the legend

legend.line.color

string, line color of the legend frame

legend.line.type

numeric, linetype of the legend frame

legend.line.width

numeric, linewidth of the legend frame

legend.title

string, title of the legend. Seems not to work when legend.position = 'right'

legend.title.size

= numeric, size of legend title

legend.title.font

= numeric, font of legend title. 1 = plain, 2 = bold

legend.title.col

= string, color of legend title

plot.background.col

string, background color of the plot

plot.title

string, title of the plot

plot.title.size

numeric, size of the plot title

plot.title.color

string, color of the plot title

strip.text

string, vector of titles of plot strips. Length must be equal to the number of plot strips

strip.text.size

numeric, size of strip text

strip.text.color

string, color of strip text

strip.text.font

numeric, font of strip text. 1 = plain, 2 = bold

strip.background.col

string, background color of the box around strip title

strip.border.col

string, color of the box around strip title

...

further parameters passed on to levelplot-methods

Examples

1
2
3
4
5
6
7
8
9
dem <- Rgadgets::rg_dem()

rg_levelplot(dem, palette = 'Inferno', xlab = c('X', 'test', 'test'), ylab = 'Y',
plot.background.col = 'gray70', plot.title = 'A new plot fn', plot.title.size = 3,
axis.line.col = 'black', strip.background.col = 'gray70', strip.border.col = 'red',
strip.text = c('test'), strip.text.size = 2, strip.text.color = 'white', legend.title = 'legend title',
legend.position = 'left', nbreaks = 10, axis.ticks.y = F, plot.title.color = 'red',
axis.labels.angle = 30, axis.labels.font = 'bold', axis.labels.color = 'yellow',
axis.labels.size = 3)

sitscholl/Rgadgets documentation built on Feb. 19, 2021, 1:24 a.m.