我对ggplot比较陌生。在尝试调整轴标题的主题参数时,我遇到了一些麻烦。具体来说,我想更改字体系列,加粗文本,并稍微向下移动 x 轴标题。我尝试了以下代码 - 我没有收到错误,但图表中没有任何变化。任何想法我做错了什么?我最担心的是用 vjust 将标题向下移动,现在它离我需要的刻度标签太近了。谢谢!
ggplot(Car_data, aes(x=Yearyear, y= Total_cars)) +
geom_line(aes(group=1), colour="#56B4E9", size = 1.5) +
geom_errorbar(aes(ymin= (Mean_Total_Cars - SE_Total_Cars), ymax= (Mean_Total_Cars + SE_Total_Cars)), width=.2, colour= "black") +
geom_point(stat = "identity", colour="gray40", size=5, shape= 18) + geom_point(stat = "identity", colour="#56B4E9", size=3, shape= 18) +
theme(axis.title.x = element_text(color = "black", size = 9, family = "Arial", face = "bold", vjust= 1)) +
theme(axis.title.y = element_text(color = "black", size = 9, family = "Arial", face = "bold")) +
theme(axis.text.x = element_text(color = "black", size = 9, family = "Arial", face = "bold")) +
theme(axis.text.y = element_text(color = "black", size = 9, family = "Arial", face = "bold")) +
ylab("Mean # Cars") +
xlab("Year")