ggspectra (version 0.3.12)

scale_y_s.e.response_continuous: Spectral response and action y-scales

Description

Scale y continuous with defaults suitable for response and action spectra.

Usage

scale_y_s.e.response_continuous(
  unit.exponent = 0,
  name = s.e.response_label(unit.exponent = unit.exponent, format = format, label.text =
    label.text, scaled = scaled, normalized = round(normalized, 1)),
  labels = SI_pl_format(exponent = -unit.exponent),
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels()[["s.e.response"]],
  scaled = FALSE,
  normalized = FALSE,
  ...
)

scale_y_s.q.response_continuous( unit.exponent = 0, name = s.q.response_label(unit.exponent = unit.exponent, format = format, label.text = label.text, scaled = scaled, normalized = round(normalized, 1)), labels = SI_pl_format(exponent = -unit.exponent), format = getOption("photobiology.math", default = "R.expression"), label.text = axis_labels()[["s.q.response"]], scaled = FALSE, normalized = FALSE, ... )

scale_y_s.e.action_continuous( unit.exponent = 0, name = s.e.action_label(unit.exponent = unit.exponent, format = format, label.text = label.text, scaled = scaled, normalized = round(normalized, 1)), labels = SI_pl_format(exponent = -unit.exponent), format = getOption("photobiology.math", default = "R.expression"), label.text = axis_labels()[["s.e.action"]], scaled = FALSE, normalized = FALSE, ... )

scale_y_s.q.action_continuous( unit.exponent = 0, name = s.q.action_label(unit.exponent = unit.exponent, format = format, label.text = label.text, scaled = scaled, normalized = round(normalized, 1)), labels = SI_pl_format(exponent = -unit.exponent), format = getOption("photobiology.math", default = "R.expression"), label.text = axis_labels()[["s.q.action"]], scaled = FALSE, normalized = FALSE, ... )

Arguments

unit.exponent

integer

name

The name of the scale, used for the axis-label.

labels

The tick labels or a function to generate them.

format

character string, "R", "R.expression", "R.character", or "LaTeX".

label.text

character Textual portion of the labels.

scaled

logical If TRUE relative units are assumed.

normalized

logical (FALSE) or numeric Normalization wavelength in manometers (nm).

...

other named arguments passed to scale_y_continuous

Examples

Run this code

ggplot(ccd.spct) +
  geom_line() +
  scale_y_s.e.action_continuous() + #  per joule
  scale_x_wl_continuous()

ggplot(ccd.spct) +
  geom_line() +
  scale_y_s.e.response_continuous() + #  per joule
  scale_x_wl_continuous()

ggplot(ccd.spct) +
  geom_line() +
  scale_y_s.e.response_continuous(unit.exponent = 6) + # per mega joule
  scale_x_wl_continuous()

ggplot(ccd.spct, unit.out = "photon") +
  geom_line() +
  scale_y_s.q.response_continuous() + # per mol
  scale_x_wl_continuous()

ggplot(ccd.spct, unit.out = "photon") +
  geom_line() +
  scale_y_s.q.response_continuous(unit.exponent = 3) + # per 1000 moles
  scale_x_wl_continuous()

norm_ccd.spct <- normalize(ccd.spct, norm = "max")
ggplot(norm_ccd.spct) +
  geom_line() +
  scale_y_s.e.response_continuous(normalized = getNormalized(norm_ccd.spct)) +
  scale_x_wl_continuous()

photon_as_default()

norm_ccd.spct <- normalize(ccd.spct, norm = "max")
ggplot(norm_ccd.spct) +
  geom_line() +
  scale_y_s.q.response_continuous(normalized = getNormalized(norm_ccd.spct)) +
  scale_x_wl_continuous()

ggplot(norm_ccd.spct) +
  geom_line() +
  scale_y_s.q.response_continuous(unit.exponent = 2,
                                  normalized = getNormalized(norm_ccd.spct)) +
  scale_x_wl_continuous()

unset_radiation_unit_default()

Run the code above in your browser using DataLab