我正在使用优秀的theme_minimal()
在 ggplot0.9.3 中找到,它具有白色背景。我想将绘图的标题放置在绘图右上角的自定义位置。在下面的例子中我知道x
and y
值,但我想知道是否有办法通过xmax
and ymax
值以确保文本放置在右上角。理想情况下,文本是右对齐的。
#example plot
p <- qplot(mpg, wt, data = mtcars, colour = cyl)
p + annotate("text", x = 30, y = 5, label = "Custom Title")
#what I would like
p + annotate("text", y= ymax, x =xmax_or_RightJustified)
你可以做
p + annotate("text", x=Inf, y = Inf, label = "Some text", vjust=1, hjust=1)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)