| plot.dem_cube | R Documentation |
Plot RGB raster cube
## S3 method for class 'dem_cube'
plot(
x,
...,
band = "ELEVATION",
tile = x[["tile"]][[1L]],
roi = NULL,
palette = "Spectral",
rev = TRUE,
scale = 1,
max_cog_size = 1024L,
legend_position = "inside"
)
x |
Object of class "dem_cube". |
... |
Further specifications for plot. |
band |
Band for plotting grey images. |
tile |
Tile to be plotted. |
roi |
Spatial extent to plot in WGS 84 - (see notes) |
palette |
An RColorBrewer or "cols4all" palette |
rev |
Reverse the color order in the palette? |
scale |
Scale to plot map (0.4 to 1.0) |
max_cog_size |
Maximum size of COG overviews (lines or columns) |
legend_position |
Where to place the legend (default = "inside") |
A plot object with a DEM cube or a B/W image on a color scale
To see which color palettes are supported, please run cols4all::c4a_gui().
Use scale parameter for general output control.
The following optional parameters are available to allow for detailed
control over the plot output:
graticules_labels_size: size of coord labels (default = 0.7)
legend_title_size: relative size of legend title (default = 0.7)
legend_text_size: relative size of legend text (default = 0.7)
legend_bg_color: color of legend background (default = "white")
legend_bg_alpha: legend opacity (default = 0.3)
To define a roi use one of:
A path to a shapefile with polygons;
A sfc or sf object from sf package;
A SpatExtent object from terra package;
A named vector ("lon_min",
"lat_min", "lon_max", "lat_max") in WGS84;
A named vector ("xmin", "xmax",
"ymin", "ymax") with XY coordinates.
Gilberto Camara, gilberto.camara@inpe.br
if (sits_run_examples()) {
# obtain the DEM cube
dem_cube_19HBA <- sits_cube(
source = "MPC",
collection = "COP-DEM-GLO-30",
bands = "ELEVATION",
tiles = "19HBA"
)
# plot the DEM reversing the palette
plot(dem_cube_19HBA, band = "ELEVATION")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.