ClimateUnboxed
ClimateUnboxed

Reputation: 8087

R How to insert zapf dingbats font characters in text for axis or legend label

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. enter image description here

Upvotes: 1

Views: 412

Answers (1)

G5W
G5W

Reputation: 37661

You just specify the appropriate Unicode value.

plot(iris[,3:4])
legend("topleft", legend=c("\U2600", "\U2601", "\U2602", "\U2603"))

Unicode Legend

Upvotes: 1

Related Questions