% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_cs_hsa.R
\name{plot_cs_hsa}
\alias{plot_cs_hsa}
\title{Visualize Constrained HespDiv Sensitivity Analysis Results}
\usage{
plot_cs_hsa(
  obj,
  type = 1,
  rank = NULL,
  col_basal = "gray20",
  main,
  col_boundary = 7,
  col_alternatives = "lightyellow3",
  max_lwd = 2.5,
  min_lwd = 0.75,
  alpha_alt = 0.6
)
}
\arguments{
\item{obj}{An object of class \code{hsa_constrained}, the output
of \code{\link{hsa_sample_constrained}}.}

\item{type}{An integer indicating the type of plot. Defaults to 1.
\describe{
\item{\code{1}}{A single plot overlaying all alternative lines
and the basal lines, colored or width-coded by rank.}
\item{\code{2}}{Multiple plots, each corresponding to a specific
rank. Alternative lines are displayed in a user-defined color
(default \code{"lightyellow3"}), with the basal line highlighted
in another color.}
}}

\item{rank}{Integer. Optional. When \code{type = 2}, if provided the function
will only generate plots for the specified rank. If \code{NULL} (default),
plots for all unique ranks will be produced.}

\item{col_basal}{Character or numeric specifying the color of basal split-lines
(default \code{"gray20"}).}

\item{main}{Character. Title for the plot(s).}

\item{col_boundary}{Character or numeric specifying the color of the outer
(first) polygon boundary (default \code{7}).}

\item{col_alternatives}{Character or numeric specifying the color of alternative
split-lines (default \code{"lightyellow3"}).}

\item{max_lwd}{Numeric. The maximum line width for the highest-ranked split-line
(default \code{2.5}).}

\item{min_lwd}{Numeric. The minimum line width for the lowest-ranked split-line
(default \code{0.75}).}

\item{alpha_alt}{Numeric in the range \code{[0, 1]}. The transparency of
alternative split-lines (default \code{0.6}).}
}
\value{
\code{NULL}. The function is called for its side effect of generating
one or more plots.
}
\description{
Displays the alternative (subsampled) \code{hespdiv} subdivisions and the
basal (original) \code{hespdiv} subdivision on one or multiple plots,
illustrating how the split-lines vary across different ranks. Additionally,
for each alternative split-line (which is defined by a start and end coordinate),
the function aggregates identical endpoints and overlays their counts on the plot.
}
\details{
\itemize{
\item In \code{type = 1}, the function creates a single plot showing all
alternative split-lines overlaid on the first polygon boundary,
plus all basal split-lines of the \code{hespdiv} basis object.
\item In \code{type = 2}, the function creates separate plots, each focusing
on polygons of a specific rank, drawing alternative lines in the user-specified
color (with transparency) and the basal line in another color or line width.
If a specific \code{rank} is provided, only that rank is plotted.
\item In both cases, after drawing the alternative split-lines the function
aggregates their endpoints (start and end coordinates) and overlays the
count at each unique coordinate using \code{text()}.
}
}
\seealso{
Other functions for hespdiv sensitivity analysis: 
\code{\link{change_base}()},
\code{\link{hsa}()},
\code{\link{hsa_detailed}()},
\code{\link{hsa_quant}()},
\code{\link{hsa_sample_constrained}()},
\code{\link{plot_hsa}()},
\code{\link{plot_hsa_q}()}

Other HespDiv visualization options: 
\code{\link{blok3d}()},
\code{\link{create_gif}()},
\code{\link{dendro}()},
\code{\link{plot.nullhespdiv}()},
\code{\link{plot_hespdiv}()},
\code{\link{plot_hsa}()},
\code{\link{plot_hsa_q}()},
\code{\link{poly_scheme}()},
\code{\link{polypop}()}
}
\concept{HespDiv visualization options}
\concept{functions for hespdiv sensitivity analysis}
