% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/additions.R
\name{set_legend}
\alias{set_legend}
\title{Set legend visibility}
\usage{
set_legend(p, show = TRUE)
}
\arguments{
\item{p}{A ggseg3d or ggsegray object}

\item{show}{logical. Whether to show the legend (default: TRUE)}
}
\value{
The input object, modified
}
\description{
For htmlwidget output, toggles legend visibility. For rgl output,
draws or removes the legend overlay.
}
\examples{
ggseg3d() |> set_legend(FALSE)
\dontrun{
# rgl requires OpenGL; not run in check environments.
ggsegray(hemisphere = "left") |> set_legend()
}
}
