相关疑难解决方法(0)

在ggplot2中更改图例键中的符号

如何更改geom_text图例符号?在下面的示例中,我想将图例键中的符号从小写"a"更改为,例如,大写"N".我已经看过一个在这里类似事情的例子,但是无法让这个例子起作用.

# Some toy data
df <- expand.grid(x = factor(seq(1:5)), y = factor(seq(1:5)), KEEP.OUT.ATTRS = FALSE)
df$Count = seq(1:25)

# An example plot
library(ggplot2)
ggplot(data = df, aes( x = x, y = y, label = Count, size = Count)) + 
   geom_text() +
   scale_size(range = c(2, 10))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

r legend ggplot2

12
推荐指数
2
解决办法
3060
查看次数

标签 统计

ggplot2 ×1

legend ×1

r ×1