Add a shaded band (with optional text overlay) to a FTIR spectral region, to visually highlight an area.
Ajoutez une bande ombrée (avec un texte en option) à une région spectrale FTIR, pour mettre visuellement en évidence une zone.
add_band(
ftir_spectra_plot,
wavenumber_range,
text = NULL,
colour = NULL,
label_aesthetics = NULL
)
the FTIR plot as a ggplot2 object, with the shaded band added.
le tracé FTIR en tant qu'objet ggplot2, avec la bande ombrée ajoutée.
A plot generated by plot_ftir()
or
plot_ftir_stacked()
.
Un tracé généré par plot_ftir()
ou plot_ftir_stacked()
.
A vector of length two, with the wavenumber range of the shaded band. Order of provided limits is not important.
Un vecteur de longueur deux, avec la gamme de nombres d'ondes de la bande ombrée. L'ordre des limites fournies n'est pas important.
The text of the label over the band (optional).
Le texte de l'étiquette au-dessus du bande (facultatif).
A colour for the shaded band. Note that alpha will be set to 0.5.
A default blue band will be added if not provided.
See vignette("ggplot2-specs", "ggplot2")
for more information on aesthetics in graphics.
Une couleur pour la bande ombrée. Notez que la valeur alpha est fixée à 0,5.
Une bande bleue sera ajoutée par défaut si aucune valeur n'est fournie.
Voir vignette(« ggplot2-specs », « ggplot2 »)
pour plus d'informations sur l'esthétique dans les graphiques.
A named list
of aesthetics to pass to ggplot for
creating the label. See [ggplot2::geom_text()]
's aesthetics section for
more info. Specifically, alpha
, colo(u)r
, family
, fill
, fontface
and
size
are permitted. Positioning aesthetics will be removed.
Une list
nommée d'esthétiques à transmettre à ggplot pour créer
l'étiquette. Voir la section esthétique de [ggplot2::geom_text()]
pour
plus d'informations. Plus précisément, alpha
, colo(u)r
, family
, fill
,
fontface
et size
sont autorisés. Les aspects esthétiques du
positionnement seront supprimés.
add_wavenumber_marker()
if (requireNamespace("ggplot2", quietly = TRUE)) {
# Generate a plot
p <- plot_ftir(sample_spectra)
# Add a band to -OH region:
add_band(p, c(3600, 3100), "-OH Stretch")
}
Run the code above in your browser using DataLab