| plot_tdt_curve | R Documentation |
Plots posterior median +/- 95% CrI of the duration to reach target_surv
across temperature. By default, returns a two-panel figure: a linear-time
panel (the absolute time to reach the target) alongside a log10-time
panel (the classical TDT view where the relationship is near-linear with
slope -1/z). Both panels share posterior draws.
plot_tdt_curve(
ltx,
panels = c("both", "linear", "log"),
colour = "#146C7C",
observed = NULL,
clip_to_observed = TRUE
)
ltx |
Output of |
panels |
One of |
colour |
Line/ribbon colour. Default |
observed |
Optional standardised data tibble (from
|
clip_to_observed |
Logical. If |
Grouped output from derive_tdt_curve() with by = ... is faceted
automatically so each moderator level gets its own TDT curve panel.
Internal y-axis behaviour: if the 95% credible interval of the LT_x curve
extends above 48 hours (converted to ltx$output_time_unit), both panels'
y-axes are clamped to 48 hours so the readable part of the curve isn't
compressed by an extreme upper tail at cool temperatures. If the data
already stay below 48 hours, no limits are applied and ggplot2 chooses
a data-driven range. To override it, append + ggplot2::coord_cartesian(ylim = ...) to a single-panel plot (panels = "linear" or "log"). For the
two-panel default, use patchwork's & so the limits reach both panels, with
a positive lower limit because one axis is logarithmic.
A ggplot object (single panel) or patchwork composition (two panels).
## Not run:
ltx <- derive_tdt_curve(wf, temp_grid = seq(29, 37, by = 0.5))
plot_tdt_curve(ltx) # two-panel default
plot_tdt_curve(ltx, panels = "log") # classical TDT view only
# Override the internal 48-h cap on one panel by appending a coord_cartesian:
plot_tdt_curve(ltx, panels = "linear") +
ggplot2::coord_cartesian(ylim = c(0, 240))
# ... or on both panels with patchwork's `&` (the log axis needs a lower
# limit above 0):
plot_tdt_curve(ltx) & ggplot2::coord_cartesian(ylim = c(1, 240))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.