如何從此代碼生成的圖例中刪除字母“a”?如果我刪除了geom_text,那么'a'字母將不會顯示在圖例中。不過我想保留geom_text。ggplot(data = iris, aes(x = Sepal.Length, y=Sepal.Width, shape = Species, colour = Species)) + geom_point() + geom_text(aes(label = Species))
3 回答

呼啦一陣風(fēng)
TA貢獻(xiàn)1802條經(jīng)驗 獲得超6個贊
設(shè)置show.legend = FALSE為geom_text:
ggplot(data = iris,
aes(x = Sepal.Length, y = Sepal.Width, colour = Species, shape = Species, label = Species)) +
geom_point() +
geom_text(show.legend = FALSE)
該參數(shù)show_guide將名稱更改為show.legendin ggplot2 2.0.0(請參閱發(fā)布新聞)。
預(yù)ggplot2 2.0.0:
有了show_guide = FALSE這樣的...
ggplot( data=iris, aes(x=Sepal.Length, y=Sepal.Width , colour = Species , shape = Species, label = Species ) , size=20 ) +
geom_point()+
geom_text( show_guide = F )
- 3 回答
- 0 關(guān)注
- 3038 瀏覽
添加回答
舉報
0/150
提交
取消