plotPopSizes: Plot Population Sizes

View source: R/plotPopSizes.R

plotPopSizesR Documentation

Plot Population Sizes

Description

Plots the output of a coalescent demographic analysis.

Usage

plotPopSizes(
  df,
  plot_CIs = TRUE,
  add = FALSE,
  existing_plot = NULL,
  col = "#00883a"
)

Arguments

df

(data frame) such as produced by processPopSizes(), containing the data on population sizes and corresponding grid points (points in time for population size evaluation)

plot_CIs

(boolean; default: TRUE) specifies whether the credible intervals should be plotted.

add

(boolean; default: FALSE) specifies whether the new plot should be added to an existing ggplot2 object. If TRUE, the existing_plot has to be given.

existing_plot

(ggplot2 object; default: NULL) a ggplot2 object to which the new plot should be added.

col

(string; default: "#00883a") color for the trajectories

Details

Plots the output of coalescent demographic analyses. Takes as input the output of processPopSizes() and plotting parameters.

The return object can be manipulated. For example, you can change the axis labels, the color palette, whether the axes are to be linked, or the overall plotting style/theme, just as with any ggplot object.

Value

a ggplot object

Examples

df <- dplyr::tibble("time" = c(0.0, 1.0, 2.0, 3.0, 4.0),
                    "value" = c(1.0, 1.5, 2.0, 1.5, 1.5),
                    "upper" = c(3.5, 7.0, 6.5, 5.0, 5.0),
                    "lower" = c(0.5, 0.1, 0.5, 0.5, 0.8))

plotPopSizes(df)


revbayes/RevGadgets documentation built on Jan. 19, 2024, 3:29 p.m.