Skip to contents

Convert ggplot to tidyplot

Usage

as_tidyplot(gg, width = 50, height = 50, dodge_width = NULL)

Arguments

gg

A ggplot.

width

Width of the plot area. Defaults to 50.

height

Height of the plot area. Defaults to 50.

dodge_width

For adjusting the distance between grouped objects. Defaults to 0.8 for plots with at least one discrete axis and 0 for plots with two continuous axes.

Value

A tidyplot object.

Examples

gg <-
  study %>%
  ggplot2::ggplot(ggplot2::aes(x = treatment, y = score, color = treatment)) +
  ggplot2::geom_point()

gg


gg %>% as_tidyplot()