annotate()
を使用してggplot2プロットにラテックステキストを追加したいと思います。 expression()
を使用すると、軸ラベルにラテックスを添加するためのhereのように機能していないようです。ウィットに:ラテックスでggplotをアノテートする方法
# Use expression() to create subscripted text
p <- ggplot(mpg, aes(x=cty, y=hwy)) + geom_point() +
scale_x_continuous(expression(text[subscript]))
# But expression() in annotate adds nothing to the plot
p + annotate("text", x=10, y=40, label=expression(text[subscript]))
# Passing regular text to annotate works fine
p + annotate("text", x=10, y=40, label="foo")
はなぜexpression
sが他のggplot機能によって、よりannotate
によって異なる扱いをされますか?ラテックスにはどのように注釈を付けることができますか?
あなたは 'tikzDevice'パッケージを見てみるかもしれません... –
もうアクティブに維持されていないようです。 (しかしまだ潜在的に有用です!) –
私は、CRAN/RのCMDチェックルールが厳格になっているため、孤児院の現状ではまだかなり広く使用されていますが、それが機能していると私は理解しています。 2012 ... –