plotLines: Plot Atomic Emission Lines

Description Usage Arguments Value Examples

View source: R/plotLines.R

Description

Plots an element's simulated atomic emission or atomic absorption line spectrum. The lines are taken from an object created using simulateAES. Atomic absorption spectra are displayed as a set of black lines superimposed on a background that shows the spectrum of visible electromagnetic radiation. Atomic emission spectra are displayed as set of lines, each of which has a color that matches its wavelength, superimosed on either a white or a black background.

Usage

1
2
3
4
5
6
7
8
9
plotLines(
  file,
  lambda.min = 390,
  lambda.max = 700,
  spectrum_type = c("emission", "absorbance"),
  emission_bg = c("white", "black"),
  scale_emission = TRUE,
  main_title = NULL
)

Arguments

file

The name of an object, created by simulateAES, that contains the results of a simulation.

lambda.min

The minimum wavelength (in nm) for scaling the x-axis; defaults to 390 nm, which is the lower limit.

lambda.max

The maximum wavelength (in nm) for scaling the x-axis; defaults to 700 nm, which is the upper limit.

spectrum_type

Type of line spectrum, either emission or absorbance. Defaults to emission.

emission_bg

For an emission spectrum, choice of background color as white or black. Defaults to white.

scale_emission

Logical value that determines whether the transparency of an emission line is scaled to the emission line's relative intensity. Defaults to FALSE, which shows all emission lines regardless of intensity; emission lines of low intensity are too faint to see when scale_emission is set to TRUE. The value for scale_emission is ignored when plotting the element's absorbance spectrum.

main_title

An optional main title. If NULL, then a default title gives the element's atomic symbol, the temperature, and the partition model.

Value

Returns a plot of the element's atomic emission line spectrum or the element's atomic absorption line spectrum.

Examples

1
2
3
4
5
6
7
8
9
hydrogen = simulateAES(atom = "H")
plotLines(file = hydrogen, spectrum_type = "emission",
   emission_bg = "white", scale_emission = TRUE)
plotLines(file = hydrogen, spectrum_type = "emission",
   emission_bg = "white", scale_emission = FALSE)
plotLines(file = hydrogen, spectrum_type = "emission",
   emission_bg = "black", scale_emission = FALSE)
plotLines(file = hydrogen, spectrum_type = "absorbance",
   emission_bg = "white", scale_emission = TRUE)

dtharvey/atomicEmission documentation built on July 11, 2021, 2 p.m.