Learn R Programming

tidyplots (version 0.2.1)

remove_legend: Remove legend or legend title

Description

Remove legend or legend title

Usage

remove_legend(plot)

remove_legend_title(plot)

Value

A tidyplot object.

Arguments

plot

A tidyplot generated with the function tidyplot().

Examples

Run this code
# 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()

Run the code above in your browser using DataLab