remove_legend: Remove legend or legend title

View source: R/remove.R

remove_legendR Documentation

Remove legend or legend title

Description

Remove legend or legend title

Usage

remove_legend(plot)

remove_legend_title(plot)

Arguments

plot

A tidyplot generated with the function tidyplot().

Value

A tidyplot object.

Examples

# Before removing
study |>
  tidyplot(x = treatment, y = score, color = treatment) |>
  add_mean_bar()

# After removing
study |>
  tidyplot(x = treatment, y = score, color = treatment) |>
  add_mean_bar() |>
  remove_legend_title()

study |>
  tidyplot(x = treatment, y = score, color = treatment) |>
  add_mean_bar() |>
  remove_legend()


tidyplots documentation built on April 3, 2025, 9:33 p.m.