% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-peak-density.R
\name{plot_peak_density}
\alias{plot_peak_density}
\title{Plot a peak density plot}
\usage{
plot_peak_density(datasets, supporting_datasets, options, single = FALSE)
}
\arguments{
\item{datasets}{A named \code{list} of data frames. The used key is
\code{peak_density}.}

\item{supporting_datasets}{A \code{list} of supporting data frames. The used key
is \code{detected_peaks}, which provides per-sample peak positions.}

\item{options}{A list of plot options.}

\item{single}{A \code{logical} value indicating whether to treat the plot as a
single dataset variant. Default is \code{FALSE}.}
}
\value{
A \code{ggplot} object representing the peak density plot.
}
\description{
\code{plot_peak_density()} generates a ggplot2 peak density plot that mirrors
\code{xcms::plotChromPeakDensity()}. For each m/z feature:
\itemize{
\item The x axis shows retention time.
\item The y axis shows sample indices (1 to n), positioned within the density
range so that sample rows are evenly spaced from 0 to \code{max(density)}.
\item Detected peaks are plotted as coloured points at each sample's y position.
\item The kernel density estimate of peak apex RTs is drawn as a line.
\item When feature group simulation is enabled, semi-transparent rectangles
mark feature groups that pass the \code{min_fraction} / \code{min_samples}
threshold.
}
}
\keyword{internal}
