I am looking for a way to modify font types in ggplot. At the moment I would be happy enough to simply change fonts to the \'courier\' font family, but ultimately my goal is
Inspired by a post on kohske's blog I came up with this:
theme_set( theme_bw( base_family= "serif"))
theme_update( panel.grid.minor= theme_blank(),
panel.grid.major= theme_blank(),
panel.background= theme_blank(),
axis.title.x= theme_blank(),
axis.text.x= theme_text( family= "serif",
angle= 90, hjust= 1 ),
axis.text.x= theme_text( family= "serif"),
axis.title.y= theme_blank())
theme_map <- theme_get()
theme_set( theme_bw())
Now when I want to use that particular theme:
last_plot() + theme_map
YMMV.
BTW, if I had the power I would vote down the preferred answer:
> grid.gedit("GRID.text",gp=gpar(fontfamily="mono"))
Error in editDLfromGPath(gPath, specs, strict, grep, global, redraw) :
'gPath' (GRID.text) not found
Not sure what this means. Nor was I offered a link to comment on that answer; maybe something has changed on the site.