-
-
Save tanerumit/3a5a4a39ba44b2f7cd9193af40676b64 to your computer and use it in GitHub Desktop.
#R #ggplot2 use any font on the system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(extrafont) | |
require(ggplot2) | |
font_import(pattern = "GIL", prompt = FALSE) # Import Gill family | |
loadfonts(device="win") # Load them all | |
fonts() # See what fonts are available | |
zp1 <- ggplot(data = iris, | |
aes(x = Sepal.Length, y = Sepal.Width, label = Species)) | |
zp1 <- zp1 + geom_text(family = "Gill Sans MT") | |
zp1 <- zp1 + theme(text=element_text(family="Gill Sans Ultra Bold")) | |
print(zp1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment