Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to use a greek symbol in grid.arrange()

I am using the grid.arrange() function in R to parse together multiple plots. My current code is structured as follows:

grid.arrange(
plot1,
plot2,
legend,
ncol = 3,
top = "Change in Score",
left = "Change in Score"
)

I am trying to change the left = "Change in Score" to the Greek symbol "Delta" in order to replace "Change in."

No clue how to do this…Thanks for any suggestions!!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I am using the iris dataset as an example. You can use Unicode Characters for in this case Delta \u0394. You can use the following code:

library(ggplot2)
plot1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +geom_point()
plot2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width)) +geom_point()

library(gridExtra)
library(grid)
grid.arrange(
  plot1,
  plot2,
  #legend,
  #ncol = 3,
  top = "Change in Score",
  left = "\u0394 Score"
)

Output:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading