2
例子:如果图例位置是底部,我怎样才能将图例标题放在标签的顶部?
xy <- data.frame(x=1:10, y=10:1, type = rep(LETTERS[1:2], each=5))
plot <- ggplot(data = xy)+
geom_point(aes(x = x, y = y, color=type)) +
theme(legend.position = 'bottom')
plot
我们怎样才能获得标题“类型” A和B的顶部,而不是给他们留下?
感谢
谢谢!我知道如何用opts做到这一点,这已经被弃用了一段时间。我无法弄清楚定位是在颜色中确定的 –