Skip to contents

Plot demographic history encoded in a slendr model

Usage

plot_model(model, sizes = TRUE, proportions = FALSE, log = FALSE)

Arguments

model

Compiled slendr_model model object

sizes

Should population size changes be visualized?

proportions

Should gene flow proportions be visualized (FALSE by default to prevent cluttering and overplotting)

log

Should the y-axis be plotted on a log scale? Useful for models over very long time-scales.

Value

A ggplot2 object with the visualized slendr model

Examples

check_dependencies(python = TRUE) # make sure dependencies are present

init_env()
#> The interface to all required Python modules has been activated.

# load an example model with an already simulated tree sequence
path <- system.file("extdata/models/introgression", package = "slendr")
model <- read_model(path)

plot_model(model, sizes = FALSE, log = TRUE)