如何在R中更改y轴的字体类型

时间:2016-08-04 17:43:55

标签: r fonts

花了不少时间谷歌搜索后,我能够将我的条形图x轴标签的字体更改为斜体,现在我意识到y轴刻度的字体也会改变。我不能很好地研究如何改变条形图x轴标签的字体并保持y轴比例。这是我的代码和生成的情节

string1 = "Percent "
string2 = " homologous lincRNA loci identified"
new = paste0(string1, species, string2) 
barplot(plot, col = "blue",
        ylab = new, ylim = c(0, max(plot)*1.15),
        font=3, las = 2)                
text(bargraph,plot,labels = plot,pos=3,cex=.8)

barplot

1 个答案:

答案 0 :(得分:0)

string1 = "Percent "
string2 = " homologous lincRNA loci identified"
new = paste0(string1, species, string2) 
barplot(plot, col = "blue",
        ylab = new, ylim = c(0, max(plot)*1.15),
        font=3, yaxt = "n", las = 2)
axis(2)                
text(bargraph,plot,labels = plot,pos=3,cex=.8)

enter image description here