Skip to contents

Scale y continuous with defaults suitable for spectral absorptance.

Usage

scale_y_Afr_continuous(
  unit.exponent = ifelse(pc.out, -2, 0),
  name = Afr_label(unit.exponent = unit.exponent, format = format, label.text =
    label.text, scaled = scaled, normalized = round(normalized, 1), axis.symbols =
    axis.symbols),
  labels = SI_pl_format(exponent = unit.exponent),
  limits = c(0, 1),
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels()[["s.Afr"]],
  scaled = FALSE,
  normalized = FALSE,
  axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE),
  pc.out = getOption("ggspectra.pc.out", default = 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.

limits

One of NULL for default based on data range, a numeric vector of length two (NA allowed) or a function that accepts the data-based limits as argument and returns new limits.

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).

axis.symbols

logical If TRUE symbols of the quantities are added to the name. Supported only by format = "R.expression".

pc.out

logical, if TRUE use percent as default instead of fraction of one.

...

other named arguments passed to scale_y_continuous

Note

This function only alters two default arguments, please, see documentation for scale_continuous

Examples


Afr_as_default()

ggplot(yellow_gel.spct) +
  geom_line() +
  scale_y_Afr_continuous() +
  scale_x_wl_continuous()
#> Warning: Conversion from internal Tfr to Afr possible only if Rfr or Rfr.constant are known.
#> Warning: Removed 425 rows containing missing values or values outside the scale range
#> (`geom_line()`).


ggplot(yellow_gel.spct) +
  geom_line() +
  scale_y_Afr_continuous(unit.exponent = -2) +
  scale_x_wl_continuous()
#> Warning: Conversion from internal Tfr to Afr possible only if Rfr or Rfr.constant are known.
#> Warning: Removed 425 rows containing missing values or values outside the scale range
#> (`geom_line()`).


ggplot(yellow_gel.spct) +
  geom_line() +
  scale_y_Afr_continuous(unit.exponent = -3) +
  scale_x_wl_continuous()
#> Warning: Conversion from internal Tfr to Afr possible only if Rfr or Rfr.constant are known.
#> Warning: Removed 425 rows containing missing values or values outside the scale range
#> (`geom_line()`).


ggplot(yellow_gel.spct) +
  geom_line() +
  scale_y_Afr_continuous(axis.symbols = FALSE) +
  scale_x_wl_continuous(axis.symbols = FALSE)
#> Warning: Conversion from internal Tfr to Afr possible only if Rfr or Rfr.constant are known.
#> Warning: Removed 425 rows containing missing values or values outside the scale range
#> (`geom_line()`).


unset_filter_qty_default()