如何在R中将y轴值加粗?

时间:2014-01-09 18:14:12

标签: r fonts boxplot

我有一个箱形图,并希望将y轴的值设为粗体。 我知道如何使y轴标题变粗。

2 个答案:

答案 0 :(得分:8)

使用par

par(font.axis = 2) # 2 means 'bold'
boxplot(1:10)

使用axis的另一种方式(由@joran提出):

boxplot(1:10, yaxt = "n") # suppress y axis
axis(side = 2, font = 2)  # 'side = 2' means y axis

enter image description here

您可以使用par(font.axis = 1)重置为普通字体。

答案 1 :(得分:3)

使用lattice

 library(lattice)
 bwplot(~1:10,scales=list(x=list(font=2,cex=5)))

enter image description here