Learn R Programming

sars (version 1.3.4)

plot.threshold: Plot Model Fits for a 'threshold' Object

Description

S3 method for class 'threshold'. plot.threshold creates plots for objects of class threshold, using the R base plotting framework. Plots of single or multiple threshold models can be constructed.

Usage

# S3 method for threshold
plot(
  x,
  xlab = NULL,
  ylab = NULL,
  pch = 16,
  cex = 1.2,
  pcol = "black",
  ModTitle = NULL,
  TiAdj = 0,
  TiLine = 0.5,
  cex.main = 1.5,
  cex.lab = 1.3,
  cex.axis = 1,
  yRange = NULL,
  lwd = 2,
  lcol = "red",
  di = NULL,
  ...
)

Arguments

x

An object of class 'threshold'.

xlab

Title for the x-axis. Defaults will depend on any axes log-transformations.

ylab

Title for the y-axis.Defaults will depend on any axes log-transformations.

pch

Plotting character (for points).

cex

A numerical vector giving the amount by which plotting symbols (points) should be scaled relative to the default.

pcol

Colour of the points.

ModTitle

Plot title (default is ModTitle = NULL), which reverts to the model names. For no title, use ModTitle = "".

TiAdj

Which way the plot title is justified.

TiLine

Places the plot title this many lines outwards from the plot edge.

cex.main

The amount by which the plot title should be scaled relative to the default.

cex.lab

The amount by which the axis titles should be scaled relative to the default.

cex.axis

The amount by which the axis labels should be scaled relative to the default.

yRange

The range of the y-axis. Default taken as the largest value bacross the observed and fitted values.

lwd

Line width.

lcol

Line colour.

di

Dimensions to be passed to par(mfrow=()) to specify the size of the plotting window, when plotting multiple plots. For example, di = c(1, 3) creates a plotting window with 1 row and 3 columns. The default (NULL) creates a plotting window large enough to fit all plots in.

Further graphical parameters (see par, plot.default,title, lines) may be supplied as arguments.

Examples

Run this code
# NOT RUN {
data(aegean)

#fit two threshold models (in logA-S space) and the linear and 
#intercept only models
fct <- sar_threshold(aegean, mod = c("ContOne", "DiscOne"),
                    non_th_models = TRUE,  interval = 5,
                    parallel = FALSE, logAxes = "area")

#plot using default settings
plot(fct)

#change various plotting settings, and set the graph margins prior to
#plotting
par(mai = c(0.7,0.7, 0.4, 0.3))
plot(fct, pcol = "blue", pch = 18, lcol = "green",
    ModTitle = c("A", "B", "C", "D"), TiAdj = 0.5, xlab = "Yorke")
# }

Run the code above in your browser using DataLab