我有这个情节
dummy = data.frame(group=c("A","B","C","D","E","F","G","H","I","J"),
y = c(80,75,68,62,75,71,73,69,60,78),
x=c(30, 32,36,34,28,41,35,29,22,33),
size =c(8,5,7,2,3,2,4,6,9,10)
)
ggplot(dummy,aes(x=x,y=y,color=group, size = size)) +
geom_point()
我不希望出现尺寸图例的文字。所以我不希望2,4,6,8 10出现在大小图例中。我仍然想要圆圈和尺寸。
我怎样才能实现这一目标?
谢谢。
答案 0 :(得分:2)
?guides
和?guide_legend
中有很多有用的信息:
ggplot(dummy,aes(x=x,y=y,color=group, size = size)) +
geom_point() +
guides(size = guide_legend(label.theme = element_blank()))