View source: R/ggplot2_extensions.R
scale_xy_percent | R Documentation |
Format the labels on the x-axis, y-axis, or both
scale_xy_percent(..., accuracy = 1)
scale_x_percent(..., accuracy = 1)
scale_y_percent(..., accuracy = 1)
scale_xy_comma(..., log10 = FALSE)
scale_x_comma(..., log10 = FALSE, accuracy = NULL)
scale_y_comma(..., log10 = FALSE, accuracy = NULL)
... |
parameters passed to underlying |
accuracy |
passed to underlying |
log10 |
should the axes be on the log10 scale? Defaults to |
library(ggplot2)
# quickly add comma format to x/y scales
tibble::tibble(x = rlnorm(1e3, 10),
y = rlnorm(1e3, 10)) |>
ggplot(aes(x, y)) +
geom_point() +
scale_xy_comma(log10 = TRUE)
# quickly add percent format to x/y scales
tibble::tibble(x = rbeta(1e3, 2, 2),
y = rbeta(1e3, 2, 2)) |>
ggplot(aes(x, y)) +
geom_point() +
scale_xy_percent()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.