View source: R/plot.ZG_output.R
| plot.ZG_output | R Documentation |
S3 plot method for output from phase.zg().
It supports tree-level ZG_phase/ZG_cycle outputs and older
vignette calls such as plot(zg_out, temporal = "daily").
## S3 method for class 'ZG_output'
plot(
x,
DOY = NULL,
Year = NULL,
type = c("gro_twd", "twd", "phase_ribbon", "abr", "phase_summary", "slope_diagnostics",
"event_timeline", "boxplot", "scatter"),
temporal = c("raw", "subdaily", "daily", "weekly", "monthly", "yearly", "event",
"cycle"),
metric = "ABr.value",
phase_names = c("TWD", "GRO"),
cols = c(GRO = "#2c7fb8", TWD = "#d95f0e"),
point_size = 2.5,
ribbon_alpha = 0.35,
show_tree = TRUE,
stat = NULL,
phase = "all",
source = c("ZG_cycle", "ZG_drought"),
xvar = NULL,
yvar = NULL,
fit = c("none", "linear"),
...
)
x |
An object of class |
DOY |
Numeric vector with initial and final day of year for plotting,
e.g. |
Year |
Numeric value indicating the calendar year for plotting.
Required when |
type |
Character. Plot type, including boxplot for cycle distributions. One of |
temporal |
Character. Temporal resolution for phase-level plots. |
metric |
Character. Event-level metric used for event plots. |
phase_names |
Character vector with two phase labels. |
cols |
Named character vector of colours for |
point_size |
Numeric point size. |
ribbon_alpha |
Numeric transparency for phase ribbons. |
show_tree |
Logical. If |
stat |
Numeric cycle column for boxplots; in ZG, an alias for metric. |
phase |
Phase names to include in boxplots, or all. |
source |
Table for scatter plots: ZG_cycle (events) or ZG_drought (days). |
xvar, yvar |
Names of numeric columns in source for scatter axes. |
fit |
Scatter fit: none or linear, with a 95 percent confidence band. |
... |
Unsupported arguments raise an error. |
For type = boxplot, each cycle/event contributes one observation. Calendar groups use event start dates, retain the year, and do not aggregate values before calculating quartiles. Non-finite measurements are excluded.
A ggplot object. Scatter plots carry scatter_stats and
scatter_model attributes. Linear fit statistics assume independent
observations and are pooled across the selected rows. Non-finite pairs are excluded.
library(dendRoAnalyst)
data(gf_nepa17)
zg.phase <- phase.zg(df = gf_nepa17, TreeNum = 1)
plot(zg.phase, DOY = c(50, 51), Year = 2017)
plot(zg.phase, temporal = "daily")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.