im.plotRGB.auto {imageRy} | R Documentation |
Automatically Plot a Raster Image as an RGB Composite
Description
This function visualizes a multispectral raster image using the first three bands as an RGB composite. It applies a linear contrast stretch to enhance visualization.
Usage
im.plotRGB.auto(x, title = "Main")
Arguments
x |
A 'SpatRaster' object representing the input multispectral image. |
title |
A character string specifying the plot title (default: "Main"). |
Details
- The function assumes that the **first three bands** of the raster correspond to the Red, Green, and Blue channels. - It uses 'plotRGB()' with 'stretch="lin"' to enhance contrast. - The plot title is customizable via the 'title' parameter. - The axis and label colors are set to white for better contrast with dark backgrounds.
Value
This function does not return an object. It directly generates a plot.
See Also
[im.import()], [im.ggplot()]
Examples
library(terra)
# Create a 3-band raster with random values
r <- rast(nrows = 10, ncols = 10, nlyrs = 3)
values(r) <- runif(ncell(r) * 3)
# Plot RGB composite
im.plotRGB.auto(r, title = "RGB Visualization")
[Package imageRy version 0.3.0 Index]