So I found out that R plotting has a few quirks (I believe): I am plotting barplots and can easily change the font to "times new roman" of these plots using par(family="serif", font=1) However, I also want to plot grouped barplots and the function which is working best for me is the barchart. Unfortunately, the font refuses to change there with the par(family="serif", font=1) command.
Does anyone have an idea how to change the font in barcharts?
In the example below you can alternatively use the barchart-line to plot or the barplot line to see the effect of par(family="serif", font=1) on the font in both cases.
molnames<-c("a")
contactcounts<-c(acounts1,acounts2,acounts3)
d<-data.frame(column1=rep(molnames, each=3),column2=rep(c("1","2","3"), 1), column3=contactcounts)
colour<-c("green", "blue","magenta")
tiff(file="./TEST.tiff", res=1000, width = 8, height = 8,units='in')
par(family="serif", font=1)
barchart(column3 ~ column1,ylab="Y test", groups=column2, d, auto.key = list(columns = 3), par.settings=list(superpose.polygon=list(col=colour)))
barplot(contactcounts)
dev.off()