geom_line_sat() draws a saturation line based on current psychrometric chart's dry-bulb temperature (x axis) range and humidity ratio (y axis) range.

geom_line_sat(
  mapping = NULL,
  data = NULL,
  units = waiver(),
  pres = waiver(),
  n = 201,
  ...,
  na.rm = FALSE
)

Arguments

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

data

The data to be displayed in this layer. There are three options:

If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot().

A data.frame, or other object, will override the plot data. All objects will be fortified to produce a data frame. See fortify() for which variables will be created.

A function will be called with a single argument, the plot data. The return value must be a data.frame, and will be used as the layer data. A function can be created from a formula (e.g. ~ head(.x, 10)).

units

A single string indicating the units sytem to use. Should be either "SI" or "IP" or waiver()which uses the value from the parent plot. Default:waiver()`

pres

A single number indicating the atmosphere pressure in Pa [SI] or Psi [IP]. If waiver(), the pressure calculated from the parent plot's altitude value will be used. Default: waiver()

n

Number of points to interpolate along

...

Other arguments passed on to layer(). These are often aesthetics, used to set an aesthetic to a fixed value, like colour = "red" or size = 3. They may also be parameters to the paired geom/stat.

na.rm

If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed.

Details

geom_line_sat() is based on ggplot2::geom_line(), so you can further customize the line style in the same way.

Normally there is no need to add another saturation line since ggpsychro() calls geom_line_sat() internally and makes sure that it is always rendered at the last.

Aesthetics

geom_line_sat() is drawing using ggplot2::geom_line() so support the same aesthetics: alpha, color, linetype and size. It also has aesthetics that control the calculation of the saturation line points (required aesthetics are in bold):

See also

Examples

# by default, a saturation line is automatically added when calling 'ggpsychro()' function ggpsychro()
# you can add another saturation line ggpsychro() + geom_line_sat(units = "SI", pres = 101325, color = "blue", size = 2)