% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gspace-themes.R
\name{theme_gspace}
\alias{theme_gspace}
\alias{theme_gspace_th0}
\alias{theme_gspace_th1}
\alias{theme_gspace_th2}
\alias{theme_gspace_th3}
\alias{theme_gspace_coords}
\alias{theme_gspace_legend}
\title{RGraphSpace ggplot2 themes}
\usage{
theme_gspace_th0(
  txt_size = 1,
  leg_size = 1,
  bg_colour = "grey95",
  discrete_fill = FALSE,
  discrete_colour = FALSE,
  ...
)

theme_gspace_th1(
  txt_size = 1,
  leg_size = 1,
  bg_colour = "grey95",
  discrete_fill = FALSE,
  discrete_colour = FALSE,
  ...
)

theme_gspace_th2(
  txt_size = 1,
  leg_size = 1,
  bg_colour = "grey95",
  discrete_fill = FALSE,
  discrete_colour = FALSE,
  ...
)

theme_gspace_th3(
  txt_size = 1,
  leg_size = 1,
  bg_colour = "grey95",
  discrete_fill = FALSE,
  discrete_colour = FALSE,
  ...
)

theme_gspace_coords(
  theme = "th0",
  is_norm = FALSE,
  xlab = "Graph coordinates 1",
  ylab = "Graph coordinates 2",
  expand = NULL,
  ...
)

theme_gspace_legend(
  leg_size = 1,
  discrete_fill = FALSE,
  discrete_colour = FALSE,
  ...
)
}
\arguments{
\item{txt_size}{Numeric value to scale plot- and axis-related text elements.}

\item{leg_size}{Numeric value to scale legend-related elements.}

\item{bg_colour}{A color name or hex code specifying the panel background.}

\item{discrete_fill}{Logical; if TRUE, treats the fill legend as discrete
to adjust key size.}

\item{discrete_colour}{Logical; if TRUE, treats the colour legend as discrete
to adjust key size.}

\item{...}{Additional arguments passed to \code{theme_gspace_th*} and
\link[ggplot2]{ggtheme}.}

\item{theme}{Character string specifying the GraphSpace theme variant.
Options: \code{th0}, \code{th1}, \code{th2}, and \code{th3}.}

\item{is_norm}{Logical; if TRUE, assumes plot coordinates are
already normalized in \code{[0, 1]}.}

\item{xlab}{The title for the 'x' axis.}

\item{ylab}{The title for the 'y' axis.}

\item{expand}{A range expansion factor applied to both the lower and
upper limits of the 'x' and 'y' scales.}
}
\value{
\code{theme_gspace_th*()} return a \code{ggplot2} theme object.

\code{theme_gspace_coords()} returns a list containing scale and theme
components that can be added to a \pkg{ggplot2} plot.

\code{theme_gspace_legend()} returns a list of theme and guide components.
}
\description{
A set of \pkg{ggplot2} themes used by \pkg{RGraphSpace} plots.
}
\details{
\code{theme_gspace_th0()} is a minimal wrapper around
\link[ggplot2]{theme_gray} that simplifies axis and legend scaling.
The \code{txt_size} and \code{leg_size} arguments aggregate related
\link[ggplot2]{theme} parameters for quick thematic overrides.

\code{theme_gspace_th1()} builds on \code{theme_gspace_th0()} and
modifies grid lines, axis appearance, and panel borders.

\code{theme_gspace_th2()} is similar to \code{theme_gspace_th1()} with
simplified grid elements and a customizable panel background.

\code{theme_gspace_th3()} is similar to \code{theme_gspace_th2()} but with
slightly adjusted margins, tick appearance, and legend formatting.

The \code{theme_gspace_coords()} is a helper function that also adds axes
scales for normalized coordinates. It configures axis breaks, limits,
and expansion for graph layouts. Plot coordinates are ideally normalized
to the interval \code{[0, 1]}.

\code{theme_gspace_legend()} is helper function that adjusts legend text,
title, and key sizes by a single scaling factor.
}
\examples{
library(RGraphSpace)
library(ggplot2)

ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  theme_gspace_th0()
  
ggplot(mtcars, 
  aes(scales::rescale(wt), 
      scales::rescale(mpg))) +
  geom_point() +
  theme_gspace_coords("th2", is_norm = TRUE)
  
# Reduce legend element sizes
ggplot(mtcars, aes(wt, mpg, fill = factor(cyl))) + 
  geom_point(shape = 21) + 
  theme_gspace_legend(0.8)

}
\seealso{
\link[ggplot2]{ggtheme}, \link[ggplot2]{theme}
}
