% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CellWindX_DimPlot.R
\name{CellWindX_DimPlot}
\alias{CellWindX_DimPlot}
\title{Visualize Seurat embeddings with CellWindX palettes}
\usage{
CellWindX_DimPlot(
  object,
  group.by = "seurat_annotations",
  reduction = c("umap", "tsne"),
  palette = c("shanshui", "chongqing_modern", "girlish"),
  label = TRUE,
  repel = TRUE,
  pt.size = 0.6,
  label.size = 4,
  alpha = 0.9,
  shuffle = TRUE,
  seed = 123,
  title = NULL,
  legend.position = "right"
)
}
\arguments{
\item{object}{A Seurat object containing dimensional reduction results.}

\item{group.by}{Character string. Metadata column used to color cells.
Default is \code{"seurat_annotations"}.}

\item{reduction}{Character string. Dimensional reduction to visualize.
One of \code{"umap"} or \code{"tsne"}.}

\item{palette}{Character string. Built-in CellWindX palette to use.
One of \code{"shanshui"}, \code{"chongqing_modern"}, or \code{"girlish"}.}

\item{label}{Logical. Whether to show group labels on the plot.
Default is \code{TRUE}.}

\item{repel}{Logical. Whether to repel text labels using ggrepel.
Default is \code{TRUE}.}

\item{pt.size}{Numeric. Point size passed to \code{\link[Seurat:DimPlot]{Seurat::DimPlot()}}.
Default is \code{0.6}.}

\item{label.size}{Numeric. Label font size. Reserved for future extension.
Default is \code{4}.}

\item{alpha}{Numeric or \code{NULL}. Point transparency. Values should usually
range from 0 to 1. Default is \code{0.9}.}

\item{shuffle}{Logical. Whether to randomly shuffle plotting order of cells.
Default is \code{TRUE}.}

\item{seed}{Integer. Random seed used when \code{shuffle = TRUE}.
Default is \code{123}.}

\item{title}{Character string or \code{NULL}. Plot title. If \code{NULL}, a default
title is automatically generated.}

\item{legend.position}{Character string. Legend position passed to
\code{\link[ggplot2:theme]{ggplot2::theme()}}. Common values include \code{"right"}, \code{"left"},
\code{"bottom"}, \code{"top"}, and \code{"none"}. Default is \code{"right"}.}
}
\value{
A ggplot object generated from \code{\link[Seurat:DimPlot]{Seurat::DimPlot()}}.
}
\description{
\code{CellWindX_DimPlot()} visualizes UMAP or t-SNE embeddings from a processed
Seurat object using built-in CellWindX color palettes. The function is designed
for annotated single-cell objects and supports three predefined aesthetic
styles: Chinese landscape-inspired, Chongqing modern, and girlish palettes.
}
\details{
This function is a wrapper around \code{\link[Seurat:DimPlot]{Seurat::DimPlot()}} with customized color
palettes and publication-oriented theme settings. It requires that the
selected dimensional reduction has already been computed and stored in
\code{object@reductions}, such as by running \code{\link[Seurat:RunUMAP]{Seurat::RunUMAP()}} or
\code{\link[Seurat:RunTSNE]{Seurat::RunTSNE()}}.

The built-in palettes support up to 20 annotated groups. If the number of
groups in \code{group.by} exceeds 20, the function will return an error.
}
\examples{
data("pbmc_small", package = "SeuratObject")

p1 <- CellWindX_DimPlot(
  object = pbmc_small,
  group.by = "groups",
  reduction = "tsne",
  palette = "shanshui"
)

p1

}
\author{
Xiaofeng Yang, Chongqing Medical University
}
