\name{plot2fOrthComparison}
\alias{plot2fOrthComparison}
\title{Algorithm Comparison for Two-Factor Orthogonal Rotation}
\description{
  Produces a \eqn{2 \times 3} panel figure comparing the \code{"legacy"},
  \code{"bb"}, and \code{"cayley"} optimization algorithms on a two-factor
  orthogonal rotation. The top row shows the criterion landscape and the
  algorithm trajectory for each algorithm; the bottom row shows the
  corresponding factor migration paths. An optional endgame inset zooms
  into the convergence region near the global minimum.
}
\usage{
plot2fOrthComparison(A, method = "quartimax", items = NULL,
                     nang = 6000, maxit = 500, magnify = FALSE, 
                     inset_pos = "auto", randomStart = FALSE, \dots)
}
\arguments{
  \item{A}{An unrotated loading matrix with exactly two columns, or a
    \code{factanal} object.}
  \item{method}{Character string naming the rotation criterion. Must be
    an orthogonal criterion available in \pkg{GPArotation}, for example
    \code{"quartimax"}, \code{"Varimax"}, or \code{"geominT"}.
    Default is \code{"quartimax"}.}
  \item{items}{Integer vector specifying which variables to include in
    the factor migration path plots. Default \code{NULL} includes all
    variables.}
  \item{nang}{Number of angles at which to evaluate the criterion landscape.
    Default \code{6000}.}
  \item{maxit}{Maximum number of iterations for each algorithm.
    Default \code{500}.}
  \item{magnify}{Logical. If \code{TRUE}, an endgame inset is added to
    each landscape panel, zooming into the convergence region near the
    global minimum. Default \code{FALSE}.}
  \item{inset_pos}{Placement of the inset. Options are "topleft", 
    "bottomleft", and the default = "auto"}
  \item{randomStart}{Initiate with random start matrix. Default = FALSE}
  \item{\dots}{Additional arguments passed to the rotation function,
    for example \code{normalize = TRUE}.}
}
\value{
  Invisibly returns a list with components \code{legacy}, \code{bb},
  and \code{cayley}, each a \code{"GPArotation"} object from the
  corresponding algorithm run.
}
\note{
  This function requires a two-factor loading matrix. The criterion
  landscape visualization is only defined for two-factor orthogonal
  rotations, where all rotation matrices are parameterized by a single
  angle \eqn{\theta \in [0, 2\pi)}.
}
\seealso{
  \code{\link{plot.GPArotation}}, \code{\link{GPForth}},
  \code{\link{rotations}}
}
\examples{
data("Harman", package = "GPArotation")
plot2fOrthComparison(Harman8, method = "quartimax", magnify = TRUE)

plot2fOrthComparison(Harman8, method = "tandemII", magnify = FALSE)
}
\keyword{hplot}