% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eim-S3.R
\name{plot.eim}
\alias{plot.eim}
\title{Plot estimated probabilities}
\usage{
\method{plot}{eim}(
  x,
  title = "Estimated probabilities",
  legend_title = "Candidates",
  color_scale = NULL,
  min_pct = 3,
  pies_per_row = NULL,
  ...
)
}
\arguments{
\item{x}{An "eim" object.}

\item{title}{Title for the plot.}

\item{legend_title}{Title for the legend.}

\item{color_scale}{A vector of colors or a palette for the candidates.}

\item{min_pct}{Minimum percentage required to display a label.}

\item{pies_per_row}{Number of pie charts to display per row. Defaults to \code{ceiling(sqrt(G))},
where \code{G} is the number of groups.}

\item{...}{Additional arguments that are ignored.}
}
\value{
Returns a \code{ggplot2} object representing the pie charts.
}
\description{
Plots the estimated probabilities as pie charts using \code{ggplot2}, one per row of the probability matrix.
Each slice displays its percentage label.
}
\examples{
\donttest{
sim <- simulate_election(
    num_ballots = 100,
    num_candidates = 4,
    num_groups = 5,
    ballot_voters = rep(40, 100),
    seed = 42
)
fit <- run_em(sim, maxiter = 5)

plot(fit, title = "Estimated probabilities", legend_title = "Candidates", min_pct = 7)
}
}
