Description Usage Arguments Examples
View source: R/ggplot2_helpers.R
For use in the labels
argument of ggplot2::scale_*_continuous
1 | one_label(x, suffix = "ms", prefix = "", position = "last")
|
x |
Vector of axis breaks |
suffix |
A string attached to the end of the text. Defaults to "ms". |
prefix |
A string attached to the beginning of the text. Defaults to "". |
position |
Which label the annotation should go to. Either 'first' (bottom/left) or 'last' (top/right). |
1 2 3 4 5 6 7 8 | ## Not run:
my_plot <- ggplot(mtcars, aes(mpg, hp)) + geom_point()
my_plot + scale_y_continuous(labels = one_label)
my_plot + scale_y_continuous(labels = function(x) one_label(x, "%"))
my_plot + scale_y_continuous(labels = function(x) one_label(x, "%", position = "first"))
my_plot + scale_y_continuous(labels = function(x) one_label(x, prefix = "$"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.