【发布时间】:2018-10-02 14:16:14
【问题描述】:
类似于this question,我想更改图例中的默认“a”,但不是完全删除它,而是想用标签本身替换它。也就是说,图例的第一行应该有一个标记为“se”的彩色图标,右侧是全名“setosa”。
iris$abbrev = substr( iris$Species, 1, 2 )
ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width,
shape = Species, colour = Species)) +
geom_text(aes(label = abbrev))
【问题讨论】:
标签: r ggplot2 legend geom-text