使用ggplot“主题”命令的添加,可以使用R中的Likert包更改图中的字体大小。但是,当条形图和直方图同时绘制在一起时,这些更改不会影响生成的图形。有没有办法修改字体大小,并同时绘制条形图和直方图?例如,下面的代码将成功地修改轴文本:李克特包R
likert.bar.plot(items, legend.position = "none") +
theme(text = element_text(size = rel(6), colour = "red"),
axis.text.y = element_text(colour = "blue",
family = "Courier"))`
...但下面的代码不会:
plot(items, include.histogram=T, legend.position = "none") +
theme(text = element_text(size = rel(6), colour = "red"),
axis.text.y = element_text(colour = "blue",
family = "Courier"))`
这个问题解释的 How do I change the text font, size and colour of all the different texts in the R package, Likert?
您可以使用'gridExtra'包进行布局,这会让事情变得更简单:'library(gridExtra); grid.arrange(A,B,宽度= C(2,1))'。 – eipi10