Skip to content

Commit

Permalink
fixed tip labeling when all spp areEXTANT
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanuario committed Aug 4, 2023
1 parent 3d501e6 commit 9994dc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/draw.sim.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ draw.sim <- function (sim, fossils = NULL, sortBy = "TS",

# warnings are not relevant here:
suppressWarnings({
min_time = min(sim$SIM$TE, na.rm = TRUE)
min_time <- min(sim$SIM$TE, na.rm = TRUE)
})
# if all species are extant, min_time must be adjusted:
if(!is.finite(min_time)){
min_time = 0
min_time <- 0
}

formals(plot.default)$xlim <-
Expand Down Expand Up @@ -338,7 +338,7 @@ draw.sim <- function (sim, fossils = NULL, sortBy = "TS",


text(y = 1:length(sim_mod$TE),
x = sim_mod$TE - ((max(sim$TS) - min(sim$TE)) * 0.035),
x = sim_mod$TE - ((max(sim$TS) - min_time) * 0.035),
labels = tiplabels)
}

Expand Down

0 comments on commit 9994dc3

Please sign in to comment.