highlight_ranges: Highlight wavelength ranges in a ggplot2 plot of hyperSpec...

Description Usage Arguments Details Examples

View source: R/highlight_ranges.R

Description

Highlight wavelength ranges in a ggplot2 plot of hyperSpec object

Usage

1
2
3
4
5
highlight_ranges(
  zones,
  fill = RColorBrewer::brewer.pal(9, "Set1")[1:length(zones)],
  alpha = 0.2
)

Arguments

zones

formula or list of formulas, that indicate which zones of wavelength axis should be highlighted e.g., 460~800.

fill

vector of rectangle fill colors to be used for each zone;

alpha

(number from 0 to 1) Level of transperency. Default is 1 (not transperent).

Details

highlight_ranges() Can be added to ggplot object using "+" operator.

Examples

1
2
3
4
5
6
gg <- ggplot(Spectra2) + geom_line()

gg + highlight_ranges(400~500)

zones <- c(400~460, 545~670)
gg + highlight_ranges(zones)

GegznaV/spPlot documentation built on April 29, 2020, 11:06 p.m.