如果我有一个标题
... +
ggtitle('Something\nSomething Else\nSomething Else')
Run Code Online (Sandbox Code Playgroud)
有什么方法可以让每条线对齐而不是左对齐在中心?
...+
theme(plot.title=element_text(hjust=0.5))
Run Code Online (Sandbox Code Playgroud)
给我中心的文字,但左对齐.
Eri*_*ail 39
这对你有用吗
# install.packages("ggplot2", dependencies = TRUE)
require(ggplot2)
DF <- data.frame(x = rnorm(400))
m <- ggplot(DF, aes(x = x)) + geom_histogram()
m + labs(title = "Vehicle \n Weight-Gas \n Mileage Relationship \n
and some really long so that you can seee it's centered") +
theme(plot.title = element_text(hjust = 0.5))
Run Code Online (Sandbox Code Playgroud)

抱歉情节标题中的拼写错误...
| 归档时间: |
|
| 查看次数: |
36199 次 |
| 最近记录: |