View source: R/translate_plot.R
translate_plot | R Documentation |
Translate all text in plot
translate_plot(plot, trans)
plot |
A plot to translate |
trans |
A named vector of translations |
p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() +
labs(title = "Test plot", caption = "Source: some")
translation <- c("Test plot" = "Testikuvio", wt = "Paino",
mpg = "Mailia per gallona", Source = "Lähde")
p2 <- translate_plot(p, translation)
library(patchwork)
pp <- p / ((p + geom_point(colour = "blue")) + (p + geom_point(colour = "red")))
pp2 <- translate_plot(pp, translation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.