x3p_add_legend: Display legend in active rgl object

View source: R/x3p_mask_legend.R

x3p_add_legendR Documentation

Display legend in active rgl object

Description

Display the legend for colors and annotations in the active rgl window. In case no rgl window is opened, a new window displaying the x3p file (using default sizes and zoom) opens.

Usage

x3p_add_legend(x3p, colors = NULL)

Arguments

x3p

x3p object with a mask

colors

named character vector of colors (in hex format by default), names contain annotations

Examples

x3p <- x3p_read(system.file("sample-land.x3p", package="x3ptools"))
## Not run: 
# run when rgl can open window on the device
x3p_image(x3p) 
x3p_add_legend(x3p) # add legend

## End(Not run)

x3ptools documentation built on May 29, 2024, 10:33 a.m.