% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gedi_plot_wrappers.R
\name{plot_embedding}
\alias{plot_embedding}
\title{Plot Embedding with Improved API}
\usage{
plot_embedding(
  model,
  embedding = NULL,
  color_by = NULL,
  color = NULL,
  projection = "zdb",
  color_limits = NULL,
  palette = c("blue", "lightgrey", "red"),
  randomize = TRUE,
  point_size = 0.3,
  alpha = 0.9,
  raster = FALSE,
  xlab = "Dim 1",
  ylab = "Dim 2",
  title = NULL,
  legend_title = NULL,
  verbose = TRUE
)
}
\arguments{
\item{model}{GEDI model object (or embedding matrix for backwards compatibility)}

\item{embedding}{Character ("umap", "pca") or Nx2 matrix}

\item{color_by}{Character: "sample", metadata column, gene name, or NULL}

\item{color}{Vector for manual coloring (overrides color_by)}

\item{projection}{Character: "zdb" or "db" for gene expression projection}

\item{color_limits}{Numeric vector c(low, high) or NULL for auto}

\item{palette}{Character vector of colors for continuous scale}

\item{randomize}{Logical, randomize point order}

\item{point_size}{Numeric, size of points}

\item{alpha}{Numeric, transparency (0-1)}

\item{raster}{Logical, use rasterization for large datasets}

\item{xlab}{Character, x-axis label}

\item{ylab}{Character, y-axis label}

\item{title}{Character, plot title}

\item{legend_title}{Character, legend title}

\item{verbose}{Logical, print computation messages}
}
\value{
ggplot2 object
}
\description{
Simplified interface for plotting embeddings with automatic caching.
Model is the first argument, and color_by handles metadata/genes automatically.
}
\examples{
\donttest{
if (requireNamespace("SeuratObject", quietly = TRUE)) {
  pbmc_small <- SeuratObject::pbmc_small
  model <- CreateGEDIObject(
    Samples = pbmc_small@meta.data$orig.ident,
    M       = pbmc_small@assays$RNA@counts,
    K       = 3,
    verbose = 0
  )
  model$train(iterations = 5)
  plot_embedding(model, embedding = "pca", color_by = "sample")
}
}

}
