View source: R/utilities-label.R
setPlotLabels | R Documentation |
Set labels properties on a ggplot object
setPlotLabels(
plotObject,
title = NULL,
subtitle = NULL,
xlabel = NULL,
ylabel = NULL,
caption = NULL
)
plotObject |
A |
title |
A character value or |
subtitle |
A character value or |
xlabel |
A character value or |
ylabel |
A character value or |
caption |
A character value or |
A ggplot
object
# Set labels of a scatter plot
p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4))
setPlotLabels(p, xlabel = "new x label", ylabel = "new y label")
# Set labels using Label object
setPlotLabels(p, ylabel = Label$new(text = "red y label", color = "red"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.