scale_x_wavenumber_continuous | R Documentation |
Scale x continuous with defaults suitable for wavelengths expressed as
wavenumbers [m^{-2}
].
scale_x_wavenumber_continuous(
unit.exponent = -6,
name = w_number_label(unit.exponent = unit.exponent, label.text = label.text,
axis.symbols = axis.symbols),
breaks = scales::pretty_breaks(n = 7),
labels = SI_pl_format(exponent = -unit.exponent),
label.text = axis_labels()[["w.number"]],
axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE),
...
)
unit.exponent |
integer |
name |
The name of the scale, used for the axis-label. |
breaks |
The positions of ticks or a function to generate them. |
labels |
The tick labels or a function to generate them from the tick positions. |
label.text |
character Textual portion of the labels. |
axis.symbols |
logical If |
... |
other named arguments passed to |
This scale automates the generation of axis labels when the variable
mapped to the x aesthetic contains numeric values for wavelengths
expressed wavenumbers. This is not how spectral data are stored in
all the packages of the R for Photobiology suite and can be used in plots
built with ggplot2()
with explicit mapping using a conversion
function. If desired, a secondary axis can be added manually as described
in sec_axis
.
This function only alters two default arguments, please, see
documentation for scale_continuous
ggplot(sun.spct, aes(x = wl2wavenumber(w.length), y = s.e.irrad)) +
geom_line() +
scale_x_wavenumber_continuous()
ggplot(sun.spct, aes(x = wl2wavenumber(w.length), y = s.e.irrad)) +
geom_line() +
scale_x_wavenumber_continuous(unit.exponent = -5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.