【发布时间】:2016-12-03 04:30:56
【问题描述】:
这里我有二维数字数组dataset 和数字一维标签数组clustring。然后我用以下代码绘制它:
s = data.frame(x = dataset[,1], y = dataset[,2])
p = ggplot(s, aes(x, y))
p + geom_point(aes(colour = factor(clustering)))
现在我想完全删除图例,所以here我找到了可能的解决方案:
# Remove legend for a particular aesthetic (fill)
p + guides(fill=FALSE)
# It can also be done when specifying the scale
p + scale_fill_discrete(guide=FALSE)
# This removes all legends
p + theme(legend.position="none")
那么如何从我的情节中删除图例?
【问题讨论】: