Reputation: 8087
I'm using the PDF device in R and I would like if possible to incorporate some characters from the zapf dingbats font in my legend lables (specifically the large open and filled circles for cloud situations of overcast and clear sky).
I found the extrafont package https://cran.r-project.org/web/packages/extrafont/extrafont.pdf but that seems to change the overall font. I also know how to use expression for greek and math symbols, but that doesn't seem to include these symbols.
I attach a plot that I made with NCL to show the kind of lable I am trying to recreate in my R script.
Upvotes: 1
Views: 412
Reputation: 37661
You just specify the appropriate Unicode value.
plot(iris[,3:4])
legend("topleft", legend=c("\U2600", "\U2601", "\U2602", "\U2603"))
Upvotes: 1