Learn R Programming

lidR (version 1.6.1)

plot.lasmetrics: Plot an object of class lasmetrics in 2D

Description

This functions implements a plot method for a lasmetrics data.frame

Usage

# S3 method for lasmetrics
plot(x, z = NULL, colorPalette = height.colors(50),
  trim = Inf, ...)

Arguments

x

A data.frame or data.table of class lasmetrics.

z

character. The field to plot. If NULL, autodetect.

colorPalette

characters. a list of colors such as those generated by heat.colors, topo.colors, terrain.colors or similar functions. Default is height.colors(50) provided by the package lidR

trim

numeric. Enables trimming of values when outliers break the color palette range. Default is +Inf (no trimming), meaning that the whole range of values is used for the color palette. 10 means that the values greater than 10 are all assigned to the highest color.

Supplementary parameters for plot

Details

The … param provides additional arguments to plot.

See Also

grid_metrics grid_canopy height.colors forest.colors heat.colors colorRampPalette

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile)

# Canopy surface model with 4 m^2 cells
plot(grid_canopy(las))

# Mean height with 400 m^2 cells
plot(grid_metrics(las, mean(Z)))

# With multiple metrics
metrics = grid_metrics(las, .stdmetrics_z)

plot(metrics)
plot(metrics, "zmean")
plot(metrics, "zmax")
# }

Run the code above in your browser using DataLab