Description Usage Arguments Details Value Note References Examples
This function creates a XKCD theme for ggplot graphics.
1 |
None
It uses the XKCD fonts. You must install this type of fonts. See Note.
A theme with white background and fonts of the XKCD family.
To install the fonts (See the vignette):
download.file("http://simonsoftware.se/other/xkcd.ttf", dest="xkcd.ttf") system("mkdir ~/.fonts") system("cp xkcd.tff -t ~/.fonts") ##library(sysfonts) font.add("xkcd", regular = "xkcd.ttf")
fibosworld 2013. Change fonts in ggplot2, and create xkcd style graphs http://fibosworld.wordpress.com/2013/02/17/change-fonts-in-ggplot2-and-create-xkcd-style-graphs/
Various Authors 2012. How can we make xkcd style graphs in R? http://stackoverflow.com/questions/12675147/how-can-we-make-xkcd-style-graphs-in-r
http://simonsoftware.se/other/xkcd.ttf
1 2 3 4 5 | ## Not run:
p <- ggplot() + geom_point(aes(mpg, wt), data=mtcars) + theme_xkcd()
p
## End(Not run)
|
Loading required package: ggplot2
Loading required package: extrafont
Registering fonts with R
Warning message:
In theme_xkcd() : Not xkcd fonts installed! See vignette("xkcd-intro")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.