mapview (version 2.7.0)

cubeView: View a RasterStack or RasterBrick as 3-dimensional data cube.

Description

Create a 3D data cube from a RasterStack or RasterBrick. The cube can be freely rotated so that Hovmoller views of x - z and y - z are possible.

Usage

cubeView(x, at, col.regions = mapviewGetOption("raster.palette"),
  na.color = mapviewGetOption("na.color"), legend = TRUE)

cubeview(...)

Arguments

x

a RasterStack or RasterBrick

at

the breakpoints used for the visualisation. See levelplot for details.

col.regions

color (palette).See levelplot for details.

na.color

color for missing values.

legend

logical. Whether to plot a legend.

...

currently not used.

Functions

  • cubeview: alias for ease of typing

Details

The visible layers are alterable by keys: x-axis: LEFT / RIGHT arrow key y-axis: DOWN / UP arrow key z-axis: PAGE_DOWN / PAGE_UP key

Note: In RStudio cubeView may show a blank viewer window. In this case open the view in a web-browser (RStudio button at viewer: "show in new window").

Note: Because of key focus issues key-press-events are not always recognised within RStudio at Windows. In this case open the view in a web-browser (RStudio button at viewer: "show in new window").

Press and hold left mouse-button to rotate the cube. Press and hold right mouse-button to move the cube. Spin mouse-wheel or press and hold middle mouse-button and move mouse down/up to zoom the cube.

Examples

Run this code
# NOT RUN {
library(raster)

kili_data <- system.file("extdata", "kiliNDVI.tif", package = "mapview")
kiliNDVI <- stack(kili_data)

cubeView(kiliNDVI)

clr <- viridisLite::viridis
cubeView(kiliNDVI, at = seq(-0.15, 0.95, 0.1), col.regions = clr)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab