thermo.plot: Functions to create and modify plots

thermo.plotR Documentation

Functions to create and modify plots

Description

Initialize a new plot window using preset parameters or add an axis to a plot.

Usage

  thermo.plot.new(xlim, ylim, xlab, ylab, cex = par("cex"),
    mar = NULL, lwd = par("lwd"), side = c(1,2,3,4), 
    mgp = c(1.7, 0.3, 0), cex.axis = par("cex"), col = par("col"),
    yline = NULL, axs = "i", plot.box = TRUE, las = 1,
    xline = NULL, grid = "", col.grid = "gray", ...)
  thermo.axis(lab = NULL, side = 1:4, line = 1.5, cex = par("cex"),
    lwd = par("lwd"), col = par("col"), grid = "", col.grid = "gray",
    plot.line = FALSE)

Arguments

xlim

numeric, limits of the x-axis

ylim

numeric, limits of the y-axis

xlab

character, x-axis label

ylab

character, y-axis label

cex

numeric, character expansion factor for labels

mar

numeric, width (number of lines) of margins on each side of plot

lwd

numeric, line width

side

numeric, which sides of plot to draw axes

mgp

numeric, sizes of margins of plot

cex.axis

numeric, character expansion factor for names of axes

col

character, color

yline

numeric, margin line on which to plot y-axis name

axs

character, setting for axis limit calculation

plot.box

logical, draw a box around the plot?

las

numeric, style for axis labels

xline

numeric, margin line on which to plot x-axis name

grid

character, type of grid (‘⁠major⁠’, ‘⁠minor⁠’, or ‘⁠both⁠’)

col.grid

character, color of the grid lines

...

further arguments passed to par

lab

character, axis label

line

numeric, margin line on which to place axis label

plot.line

logical, draw axis lines?

Details

thermo.plot.new sets parameters for a new plot, creates a new plot using plot.new, and adds the axes tick marks to the plot. Plot parameters (see par) including cex, mar, lwd, mgp and axs can be given, as well as a numeric vector in side identifying which sides of the plot receive tick marks. yline, if present, denotes the margin line (default par('mgp')[1]) where the y-axis name is plotted. thermo.axis is the function that actually adds the axes, including inward-pointing major and minor tick marks (often used for thermodynamic property diagrams).

Use grid to add a grid to the plot, corresponding to either the major ticks (solid lines), minor ticks (dashed lines), or both. The grid can be made by adding grid argument to diagram, or by calling thermo.axis after diagram (see example).

See Also

diagram uses thermo.plot.new to set up a new plot, unless the argument tplot is set to FALSE in diagram.

Examples

# Start a new plot with specific settings
thermo.plot.new(c(0, 10), c(0, 100), xlab = "X variable", ylab = "Y variable")

# Add major and minor tick marks to an existing plot
plot(1:10)
thermo.axis()

CHNOSZ documentation built on Dec. 9, 2025, 3:01 p.m.