Graphics Reference
In-Depth Information
# Find and save information about fonts installed on your system
font_import()
# List the fonts
fonts()
After the one-time setup is done, there are tasks you need to do in each R session:
library(extrafont)
# Register the fonts for Windows
loadfonts( "win" )
Finally, you can create each output file or display graphs on screen, as in Figure 14-5 :
library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() +
ggtitle( "Title text goes here" ) +
theme(text = element_text(size = 16 , family = "Georgia" , face = "italic" ))
ggsave( "myplot.png" , width = 4 , height = 4 , dpi = 300 )
Search WWH ::




Custom Search