小编L.D*_*.D.的帖子

如何在ggplot2的geom_text()标签中向标签添加希腊字母

我试图用希腊符号 kappa 标记 geom_tile 中的瓷砖,如下所示

kappa = 价值

我试过使用 expression() 和 bquote() 但找不到让它工作的方法

df = data.frame(x = letters[1:10],y = letters[11:20], value = 1:10)

p = ggplot(df, aes(x = x, y = y)) +
  geom_tile()+geom_text(aes(label= paste("k = ",value,"")), color = "white")

p

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/5bDLv.png
Run Code Online (Sandbox Code Playgroud)

r ggplot2 geom-text

5
推荐指数
1
解决办法
283
查看次数

标签 统计

geom-text ×1

ggplot2 ×1

r ×1