addPlot() adds another set of values to an existing ggplot. The first
method supports adding an ArraySpeciesBySize object to a compatible plot,
for example to compare the same rate before and after a model change.
The method checks whether the existing plot uses a compatible x variable,
and warns if the y variable or y-axis units appear to differ.
addPlot(
plot,
x,
species = NULL,
total = FALSE,
background = TRUE,
colour = NULL,
linetype = "dashed",
linewidth = 0.8,
alpha = 1,
...
)A ggplot2 object.
A ggplot2 object to which the new values should be added.
An object containing the values to add.
Character vector of species to include. NULL (default) means
all species.
A boolean value that determines whether the total over all
selected species is plotted as well. Default is FALSE.
A boolean value that determines whether background species
are included. Ignored if the model does not contain background species.
Default is TRUE.
Optional fixed colour for the added lines. If NULL, the
species colours from the existing plot are used.
Optional fixed line type for the added lines. If NULL, the
species line types from the existing plot are used.
Width of the added lines.
Transparency of the added lines.
Further arguments used by only some of the methods:
For ArraySpeciesBySize methods:
all.sizesIf FALSE (default), values outside a species' size
range (w_min to w_max) are removed.
wlimA numeric vector of length two providing lower and upper
limits for the weight (x) axis. Use NA to refer to the existing
minimum or maximum.
llimA numeric vector of length two providing lower and upper
limits for the length (x) axis when size_axis = "l". Use NA to
refer to the existing minimum or maximum.
size_axisWhether to plot size as weight ("w", default) or
length ("l"), using the allometric weight-length relationship.
For ArrayTimeBySpecies methods:
tlimA numeric vector of length two providing lower and upper
limits for the time axis, e.g. c(1980, 2000). Use NA to apply no
limit at that end. Default is c(NA, NA).
ylimA numeric vector of length two providing lower and upper limits for the value (y) axis.
Other plotting functions:
animate.ArrayTimeBySpeciesBySize(),
plot,
plot2(),
plotBiomass(),
plotCDF(),
plotCDF2(),
plotDiet(),
plotFMort(),
plotFeedingLevel(),
plotGrowthCurves(),
plotMizerParams,
plotMizerSim,
plotPredMort(),
plotRelative(),
plotSpectra(),
plotSpectra2(),
plotSpectraRelative(),
plotYield(),
plotYieldGear(),
plotting_functions
# \donttest{
p <- plot(getEncounter(NS_params), species = "Cod")
addPlot(p, getEncounter(NS_params), species = "Cod")
# }
Run the code above in your browser using DataLab