Learn R Programming

stars (version 0.1-1)

plot.stars: plot stars object, with subplots for each level of first non-spatial dimension

Description

plot stars object, with subplots for each level of first non-spatial dimension

Usage

# S3 method for stars
plot(x, y, ..., join_zlim = TRUE, main = names(x)[1],
  axes = FALSE, downsample = TRUE, nbreaks = 11, breaks = "quantile",
  col = grey(1:(nbreaks - 1)/nbreaks), key.pos = get_key_pos(x, ...),
  key.width = lcm(1.8), key.length = 0.618, reset = TRUE,
  box_col = grey(0.8))

# S3 method for stars image(x, ..., band = 1, attr = 1, asp = NULL, rgb = NULL, maxColorValue = max(x[[attr]]), xlab = if (!axes) "" else names(dims)[1], ylab = if (!axes) "" else names(dims)[2], xlim = st_bbox(x)$xlim, ylim = st_bbox(x)$ylim, text_values = FALSE, axes = FALSE, interpolate = FALSE)

Arguments

x

object of class stars

y

ignored

...

for plot, passed on to image.stars; for image, passed on to image.default or rasterImage.

join_zlim

logical; if TRUE, compute a single, joint zlim (color scale) for all subplots from x

main

character; subplot title prefix; use "" to get only time, use NULL to suppress subplot titles

axes

logical; should axes and box be added to the plot?

downsample

logical; if TRUE will try to plot not many more pixels than actually are visibule.

nbreaks

number of color breaks; should be one more than number of colors. If missing and col is specified, it is derived from that.

breaks

actual color breaks, or a method name used for classIntervals.

col

colors to use for grid cells

key.pos

integer; side to plot a color key: 1 bottom, 2 left, 3 top, 4 right; set to NULL to omit key. Ignored if multiple columns are plotted in a single function call. Default depends on plot size, map aspect, and, if set, parameter asp.

key.width

amount of space reserved for width of the key (labels); relative or absolute (using lcm)

key.length

amount of space reserved for length of the key (labels); relative or absolute (using lcm)

reset

logical; if FALSE, keep the plot in a mode that allows adding further map elements; if TRUE restore original mode after plotting; see details.

box_col

color for box around sub-plots; use 0 to suppress plotting of boxes around sub-plots.

band

integer; which band (dimension) to plot

attr

integer; which attribute to plot

asp

numeric; aspect ratio of image

rgb

integer; specify three bands to form an rgb composite

maxColorValue

numeric; passed on to rgb

xlab

character; x axis label

ylab

character; y axis label

xlim

x axis limits

ylim

y axis limits

text_values

logical; print values as text on image?

interpolate

logical; when using rasterImage (rgb), should pixels be interpolated?

Examples

Run this code
# NOT RUN {
tif = system.file("tif/L7_ETMs.tif", package = "stars")
x = read_stars(tif)
image(x, col = grey((3:9)/10))
image(x, rgb = c(1,3,5)) # rgb composite
# }

Run the code above in your browser using DataLab