util.legend: Functions to Make Legend Text

util.legendR Documentation

Functions to Make Legend Text

Description

Generate expressions describing system conditions that can be added to legends of plots.

Usage

  lNaCl(x, digits = 2)
  lS(x, digits = 3)
  lT(x, digits = 0)
  lP(x, digits = 0)
  lTP(x, y, digits = 0)
  lex(...)

Arguments

x

numeric, value of the property

digits

numeric, digits for rounding

y

numeric, value of pressure

...

language, objects to combine in an expression

Details

These functions are used to make expressions for common chemical system variables that can be used in plot legends. lNaCl describe the molality of NaCl, and lS the total molality of sulfur. lT and lP describe the temperature and pressure. lTP describe the temperature and pressure together, separated by a comma.

The above functions return language objects, which can be combined with lex to make an expression that when used in legend appears on multiple lines.

See Also

util.expression

Examples

plot.new()
l <- lex(lTP(100, "Psat"), lNaCl(1), lS(1e-3))
legend("center", l)

CHNOSZ documentation built on May 29, 2024, 3:30 a.m.