15
library(ggplot2)
my_title = "This is a really long title of a plot that I want to nicely wrap \n and fit onto the plot without having to manually add the backslash n, but at the moment it does not"
r <- ggplot(data = cars, aes(x = speed, y = dist))
r + geom_smooth() + #(left)
opts(title = my_title)
我可以設置陰謀標題環繞和縮小文本以適應情節?R:ggplot2,我可以設置陰謀標題環繞並縮小文本以適應陰謀嗎?
'opt'和'theme_text'已經改名:https://github.com/wch/ggplot2/wiki/New-theme-system – 2013-02-11 20:43:09
更新:我覺得在最近ggplot,您可以添加標題只需使用「\ n」 – 2013-10-21 22:27:58