% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pheno_anomaly.R
\name{plot.pheno_anomaly}
\alias{plot.pheno_anomaly}
\title{Plot Method for Phenological Anomalies}
\usage{
\method{plot}{pheno_anomaly}(x, which = c("timeline", "histogram"), ...)
}
\arguments{
\item{x}{A \code{pheno_anomaly} object returned by
\code{\link{pheno_anomaly}}.}

\item{which}{Character string selecting the plot type: \code{"timeline"}
(default) shows \code{anomaly_days} per year as bars coloured by
\code{direction} with extreme events marked; \code{"histogram"} shows
the distribution of anomaly values.}

\item{...}{Additional arguments (unused).}
}
\value{
A \code{ggplot} object (returned invisibly).
}
\description{
Visualise phenological anomalies as a colour-coded timeline or as a
histogram of anomaly magnitudes.
}
\examples{
\donttest{
pep <- pep_download()
vine_ch <- pep[country == "Switzerland" & species == "Vitis vinifera"]

if (nrow(vine_ch) > 0) {
  a <- pheno_anomaly(vine_ch,
                     baseline_period = 1961:1990,
                     phase_id = 65,
                     by = "phase_id")
  plot(a)
  plot(a, which = "histogram")
}
}

}
\seealso{
\code{\link{pheno_anomaly}}, \code{\link{pheno_normals}}
}
\author{
Matthias Templ
}
