geom_grid_*() geoms draw grid line of constant psychrometric properties, including relative humidity, wet-bulb temperature, water vapor pressure, specific volume and enthalpy, based on current psychrometric chart's dry-bulb temperature range and humidity ratio range.

geom_grid_relhum(
  mapping = NULL,
  data = NULL,
  n = 201,
  label_loc = 0.95,
  label_parse = FALSE,
  units = waiver(),
  pres = waiver(),
  ...,
  na.rm = FALSE
)

geom_grid_wetbulb(
  mapping = NULL,
  data = NULL,
  label_loc = 0.1,
  label_parse = TRUE,
  units = waiver(),
  pres = waiver(),
  ...,
  na.rm = FALSE
)

geom_grid_vappres(
  mapping = NULL,
  data = NULL,
  label_loc = 0.5,
  label_parse = FALSE,
  units = waiver(),
  pres = waiver(),
  ...,
  na.rm = FALSE
)

geom_grid_specvol(
  mapping = NULL,
  data = NULL,
  label_loc = 0.95,
  label_parse = TRUE,
  units = waiver(),
  pres = waiver(),
  ...,
  na.rm = FALSE
)

geom_grid_enthalpy(
  mapping = NULL,
  data = NULL,
  label_loc = 0.95,
  label_parse = TRUE,
  units = waiver(),
  pres = waiver(),
  ...,
  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)).

n

Number of points to interpolate along. Only used in geom_grid_relhum().

label_loc

A single number in range (0, 1) indicating label position relative to the line. The default values aim to reduce overlappings among differnent psychrometric property lines, but you can change them if needed:

  • 0.95 for constant relative humidity lines

  • 0.10 for constant wet-bulb temperature lines

  • 0.50 for constant water vapor pressure lines

  • 0.95 for constant specific volume lines

  • 0.95 for constant enthalpy lines

label_parse

If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath.

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

...

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_grid_relhum() for relative humidity grid in range [0, 100] in %

  • geom_grid_wetbulb() for wet-bulb temperature grid in degree_F [IP] or degree_C [SI]

  • geom_grid_vappres() for partial pressure grid of water vapor in Psi [IP] or Pa [SI]

  • geom_grid_specvol() for specific volume grid in ft3 lb-1 of dry air [IP] or in m3 kg-1 of dry air [SI]

  • geom_grid_enthalpy() for moist air enthalpy grid in Btu lb-1 [IP] or kJ kg-1

Each geom_grid_*() comes along with a corresponding scale_*() function for customizing scale properties, including breaks, labels and etc.

For each psychrometric properties, the maximum and minimum value is calculated based on the ranges of dry-bulb temperature and humidity ratio in the coordinate system.

Alignment

You can modify text alignment with the vjust and hjust aesthetics. These can either be a number between 0 (right/bottom) and 1 (top/left) or a character ("left", "middle", "right", "bottom", "center", "top"). There are two special alignments: "inward" and "outward". Inward always aligns text towards the center, and outward aligns it away from the center.

Aesthetics

geom_grid_*() understands the following aesthetics.

  • color

  • size

  • linetype

  • alpha

  • label.colour

  • label.size

  • label.angle

  • label.hjust

  • label.vjust

  • label.alpha

  • label.family

  • label.fontface

  • label.lineheight

Examples

# add all grid components ggpsychro() + geom_grid_relhum() + geom_grid_wetbulb() + geom_grid_vappres() + geom_grid_specvol() + geom_grid_enthalpy()
# custom grid style ggpsychro() + geom_grid_relhum(alpha = 1.0, label.alpha = 1.0, label.size = 6, label.fontface = 2) + geom_grid_wetbulb(size = 1.0, color = "black", alpha = 1.0, label_loc = NA) + geom_grid_vappres(label.size = 5)