# ggplot() methods for spectral objects set a default mapping for x and y.
# two spurious(?) spikes
ggplot(sun.spct) +
geom_line() +
stat_spikes(colour = "red", alpha = 0.3)
# no spikes detected
ggplot(sun.spct) +
geom_line() +
stat_spikes(colour = "red", alpha = 0.3,
max.spike.width = 3,
z.threshold = 12)
# small noise spikes detected
ggplot(white_led.raw_spct) +
geom_line() +
stat_spikes(colour = "red", alpha = 0.3)
ggplot(white_led.raw_spct) +
geom_line() +
stat_spikes(colour = "red", alpha = 0.3) +
stat_spikes(geom = "text", colour = "red", check_overlap = TRUE,
vjust = -0.5, label.fmt = "%3.0f nm")
ggplot(white_led.raw_spct, aes(w.length, counts_2)) +
geom_line() +
stat_spikes(colour = "red", alpha = 0.3,
max.spike.width = 3,
z.threshold = 12)
Run the code above in your browser using DataLab