Skip to contents

plotCDF2() compares cumulative distributions from two MizerParams or MizerSim objects in a single plot. Colours identify species or groups and linetype identifies the object.

Usage

plotCDF2(
  object1,
  object2,
  name1 = "First",
  name2 = "Second",
  power = 1,
  normalise = TRUE,
  log_x = TRUE,
  log = NULL,
  resource = FALSE,
  ...
)

plotlyCDF2(
  object1,
  object2,
  name1 = "First",
  name2 = "Second",
  power = 1,
  normalise = TRUE,
  log_x = TRUE,
  log = NULL,
  resource = FALSE,
  ...
)

Arguments

object1

First MizerParams or MizerSim object.

object2

Second MizerParams or MizerSim object.

name1, name2

Labels for the two objects, used in the linetype legend.

power

The abundance is plotted as the number density times the weight raised to power. The default power = 1 gives the biomass density, whereas power = 2 gives the biomass density with respect to logarithmic size bins.

normalise

If TRUE (default), plot the cumulative proportion. If FALSE, plot the cumulative abundance, biomass, or other unnormalised integral.

log_x

If TRUE (default), use a log10 x-axis.

log

Character string specifying whether the x-axis should use a log10 scale, in the same form as the base plot() argument. For plotCDF(), only "x" and "" are supported. If supplied, this overrides log_x.

resource

A boolean value that determines whether resource is included. Default is FALSE.

...

Arguments passed to plotCDF() for preparing the cumulative distribution data, for example species, time_range, wlim, resource, background or total.

Value

A ggplot2 object.

plotlyCDF2() returns a plotly object.

Examples

# \donttest{
sim1 <- project(NS_params, t_max = 10, progress_bar = FALSE)
sim2 <- project(NS_params, effort = 0.5, t_max = 10, progress_bar = FALSE)
plotCDF2(sim1, sim2, "Original", "Effort = 0.5")

# }