R: Secondary axes for wavelengths

sec_axis_w_number {ggspectra} | R Documentation

## Secondary axes for wavelengths

### Description

Secondary axes for wavelength data in nanometres. With suitable scaling and name (axis label) for frequency and wavenumber.

### Usage

    sec_axis_w_number(unit.exponent = -6)

    sec_axis_w_frequency(unit.exponent = 12)

### Arguments

`unit.exponent` | integer

### Examples

    library(ggplot2)
    library(photobiology)

    ggplot(sun.spct) +
      geom_line() +
      scale_x_continuous(name = w_length_label(),
                         sec.axis = sec_axis_w_number())

    ggplot(sun.spct) +
      geom_line() +
      scale_x_continuous(name = w_length_label(),
                         sec.axis = sec_axis_w_number(-4))

    ggplot(sun.spct) +
      geom_line() +
      scale_x_continuous(name = w_length_label(),
                         sec.axis = sec_axis_w_number(nearest_SI_exponent(-4)))

    ggplot(sun.spct) +
      geom_line() +
      scale_x_continuous(name = w_length_label(),
                         sec.axis = sec_axis_w_number(-3))

    ggplot(sun.spct) +
      geom_line() +
      scale_x_continuous(name = w_length_label(),
                         sec.axis = sec_axis_w_frequency())

[Package ggspectra version 0.2.3 Index]