set_legend: Set legend visibility

View source: R/additions.R

set_legendR Documentation

Set legend visibility

Description

For htmlwidget output, toggles legend visibility. For rgl output, draws or removes the legend overlay.

Usage

set_legend(p, show = TRUE)

Arguments

p

A ggseg3d or ggsegray object

show

logical. Whether to show the legend (default: TRUE)

Value

The input object, modified

Examples

## Not run: 
ggseg3d() |> set_legend(FALSE)
ggsegray(hemisphere = "left") |> set_legend()

## End(Not run)

ggseg3d documentation built on Feb. 21, 2026, 1:06 a.m.