Skip to contents

Automatically detects discrete / continuous / date scale type and applies user-supplied arguments via do.call.

Usage

fmt_scale(plot, scale_x_list = NULL, scale_y_list = NULL)

Arguments

plot

A ggplot, patchwork, or list of ggplots.

scale_x_list

Named list of arguments for the x-axis scale function.

scale_y_list

Named list of arguments for the y-axis scale function.

Value

Same type as input.

Examples

library(ggplot2)
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()
fmt_scale(p, scale_x_list = list(limits = c(4, 8), breaks = seq(4, 8, 1)))