% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/method-plot.R
\name{plot}
\alias{plot}
\alias{plot,INLAvaan,ANY-method}
\title{Plot an INLAvaan Object}
\usage{
\S4method{plot}{INLAvaan,ANY}(
  x,
  y,
  type = c("marg_pdf", "sn_fit", "sn_fit_log"),
  params = "all",
  nrow = NULL,
  ncol = NULL,
  use_ggplot = TRUE,
  points = FALSE,
  ...
)
}
\arguments{
\item{x}{An object of class \link{INLAvaan}.}

\item{y}{Not used.}

\item{type}{Character. One of \code{"marg_pdf"} (default; posterior marginal
densities), \code{"sn_fit"} (skew-normal fit diagnostic on natural scale),
or \code{"sn_fit_log"} (same on log scale).}

\item{params}{Character vector of parameter names to plot, or \code{"all"}
(default) to plot all free parameters.}

\item{nrow, ncol}{Integer. Number of rows/columns for the facet grid when
\code{use_ggplot = TRUE}. If \code{NULL} (default), layout is chosen
automatically.}

\item{use_ggplot}{Logical. When \code{TRUE} (default) and \pkg{ggplot2} is
available, a \pkg{ggplot2} object is returned. Set to \code{FALSE} for a
base-R plot.}

\item{points}{Logical. When \code{TRUE}, individual grid points are overlaid
on the curves. Defaults to \code{FALSE}.}

\item{...}{Additional arguments (currently unused).}
}
\description{
Generates diagnostic plots for a fitted \code{INLAvaan} model.
}
\examples{
\donttest{
HS.model <- "
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9
"
utils::data("HolzingerSwineford1939", package = "lavaan")
fit <- acfa(HS.model, HolzingerSwineford1939, std.lv = TRUE, nsamp = 100,
            test = "none", verbose = FALSE)

# Posterior marginal densities (default)
plot(fit)

# Skew-normal fit diagnostic for a single parameter
plot(fit, type = "sn_fit", params = "visual=~x1")
}

}
\seealso{
\code{\link[=diagnostics]{diagnostics()}}, \code{\link[=summary]{summary()}}
}
