S3 method for class 'sars'. plot.sars
creates plots for
objects of class 'sars' (type = 'fit', "lin_pow' and 'fit_collection'),
using the R base plotting framework. The exact plot(s) constructed depends
on the 'Type' attribute of the 'sars' object. For example, for a 'sars'
object of Type 'fit', the plot.sars
function returns a plot of the
model fit (line) and the observed richness values (points). For a 'sars'
object of Type 'fit_collection' the plot.sars
function returns
either a grid with n individual plots (corresponding to the n model fits in
the fit_collection), or a single plot with all n model fits included.
For plotting a 'sar_multi' object, see plot.multi
.
# S3 method for sars
plot(x, mfplot = FALSE, xlab = NULL, ylab = NULL,
pch = 16, cex = 1.2, pcol = "dodgerblue2", ModTitle = NULL,
TiAdj = 0, TiLine = 0.5, cex.main = 1.5, cex.lab = 1.3,
cex.axis = 1, yRange = NULL, lwd = 2, lcol = "dodgerblue2",
di = NULL, pLeg = FALSE, ...)
An object of class 'sars'.
Logical argument specifying whether the model fits in a
fit_collection should be plotted on one single plot (mfplot = TRUE
)
or separate plots (mfplot = FALSE
; the default).
Title for the x-axis (default depends on the Type attribute).
Title for the y-axis (default depends on the Type attribute).
Plotting character (for points).
A numerical vector giving the amount by which plotting symbols (points) should be scaled relative to the default.
Colour of the points.
Plot title (default is ModTitle = NULL
, which reverts
to a default name depending on the type of plot). For no title, use
ModTitle = ""
. For a sars object of type fit_collection, a vector of
names can be provided (e.g. letters[1:3]
).
Which way the plot title is justified.
Places the plot title this many lines outwards from the plot edge.
The amount by which the plot title should be scaled relative to the default.
The amount by which the axis titles should be scaled relative to the default.
The amount by which the axis labels should be scaled relative to the default.
The range of the y-axis.
Line width.
Line colour.
Dimensions to be passed to par(mfrow=())
to specify the size
of the plotting window, when plotting multiple plots from a sars object of
Type fit_collection. For example, di = c(1, 3)
creates a plotting
window with 1 row and 3 columns. The default (null) creates a square
plotting window of the correct size.
Logical argument specifying whether or not the legend should be
plotted for fit_collection plots (when mfplot = TRUE
) or sar_multi
plots. When a large number of model fits are plotted the legend takes up a
lot of space, and thus the default is pLeg = FALSE
.
# NOT RUN {
data(galap)
#fit and plot a sars object of Type fit.
fit <- sar_power(galap)
plot(fit, ModTitle = "A)", lcol = "blue")
#fit and plot a sars object of Type fit_collection.
fit2 <- sar_expo(galap)
fit3 <- sar_epm1(galap)
fc <- fit_collection(fit, fit2, fit3)
plot(fc, ModTitle = letters[1:3], xlab = "Size of island")
# }
Run the code above in your browser using DataLab