【发布时间】:2018-07-07 19:59:34
【问题描述】:
我无法为我的 ggplot2 图表制作字幕。我尝试了答案here,但它仅适用于您有一个学名的情况。就我而言,我想在情节标题中包含两个学名。
这是我想要包含的字幕:
“子弹头金枪鱼 (Auxis rochei) 和海盗鳀鱼 (Encrasicholina punctifer) 的高产量归因于 2016 年上岸量的增加。”
我希望它是多行的,因为它很长。
我的初始代码(一行):
mysubtitle <- expression(paste("High quantity of Bullet tuna ", italic("Auxis rochei"), " and ", "Buccaneer anchovy ", italic("Encrasicholina punctifer"), " were attributed to the increase in the landings in 2016."))
我试过了:
mysubtitle <- expression(atop(paste("High quantity of Bullet tuna (", italic("Auxis rochei"), ") and ", "Buccaneer anchovy (", italic("Encrasicholina punctifer"), ")"), paste("were attributed to the increase in the landings in 2016.")))
上面的代码生成了一个两行标题,但它是居中的,尽管在我的 ggplot2 主题plot.subtitle = element_text(hjust = 0) 中。我希望它与主情节标题保持一致。
注意:我在主情节标题上没有问题(在 ggplot2 labs 函数中称为title)。仅在subtitle 中。另外,我还有一个单独的主标题。
【问题讨论】: