guide_axis_label_trans <- function(label_trans = identity, ...) {
axis_guide <- ggplot2::guide_axis(...)
axis_guide$label_trans <- rlang::as_function(label_trans)
class(axis_guide) <- c("guide_axis_trans", class(axis_guide))
axis_guide
}
guide_train.guide_axis_trans <- function(x, ...) {
trained <- NextMethod()
trained$key$.label <- x$label_trans(trained$key$.label)
trained
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.