ggplot font family change between versions ggplot font family change between versions windows windows

ggplot font family change between versions


You might want to take a look at this page, http://wiki.stdout.org/rcookbook/Graphs/Fonts/, for some tips on dealing with font issues with ggplot/ggplot2. Also there is an example R script that will generate a table of all the fonts rendered so you can compare them a little easier between the 2 systems.

make_font_table.R

fonttable <- read.table(header=TRUE, sep=",", stringsAsFactors=FALSE,                        text='Short,Canonical,mono,Courier,sans,Helvetica,serif,Times,AvantGarde,Bookman,Helvetica-Narrow,NewCenturySchoolbook,Palatino,URWGothic,URWBookman,NimbusMonURWHelvetica,NimbusSan,NimbusSanCond,CenturySch,URWPalladioURWTimes,NimbusRom')fonttable$pos <- 1:nrow(fonttable)library(reshape2)fonttable <- melt(fonttable, id.vars="pos", measure.vars=c("Short","Canonical"),                  variable.name="NameType", value.name="Font")# Make a table of faces. Make sure factors are ordered correctlyfacetable <- data.frame(Face = factor(c("plain","bold","italic","bold.italic"),                                      levels = c("plain","bold","italic","bold.italic")))fullfonts <- merge(fonttable, facetable)library(ggplot2)pf <- ggplot(fullfonts, aes(x=NameType, y=pos)) +              geom_text(aes(label=Font, family=Font, fontface=Face)) +             facet_wrap(~ Face, ncol=2)pf

You can run it like so:

% R> source ("make_font_table.R")> pf

   ss of font table

NOTICE: Only some of the fonts (Timea, Helvetica, Courier) are actually getting rendered.

Also you might want to check out the extrafont-package. Finally this post shows how to use the extrafont-package so that you get better looking fonts rendered in your output.