Learn R Programming

lidR (version 1.6.1)

plot.LAS: Plot LiDAR data

Description

This functions implements a 3D plot method for LAS objects

Usage

# S3 method for LAS
plot(x, y, color = "Z", colorPalette = height.colors(50),
  bg = "black", trim = 1, backend = c("rgl", "pcv"), ...)

Arguments

x

An object of the class LAS

y

Unused (inherited from R base)

color

characters. The field used to color the points. Default is Z coordinates.

colorPalette

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

bg

The color for the background. Default is black.

trim

numeric. Enables trimming of values when outliers break the color palette range. Default is 1, meaning that the whole range of values is used for the color palette. 0.9 means that 10% of the highest values are not used to define the color palette. In this case values higher than the 90th percentile are set to the highest color. They are not removed.

backend

character. Can be "rgl" or "pcv". If "rgl" is chosen the display relies on the rgl package. If "pcv" is chosen it relies on the PointCloudViewer package which is much more efficient and can handle million of points using few memory. PointCloudViewer is not available on CRAN yet and should be install from github (see. https://github.com/Jean-Romain/PointCloudViewer).

Supplementary parameters for points3d

See Also

points3d height.colors forest.colors heat.colors colorRampPalette Class LAS

Examples

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

plot(lidar)

# Outliers of intensity breaks the color range. Use the trim parameter.
plot(lidar, color = "Intensity", colorPalette = heat.colors(50))
plot(lidar, color = "Intensity", colorPalette = heat.colors(50), trim = 0.99)
# }

Run the code above in your browser using DataLab