Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个主题几乎涵盖了 R 中图例的所有属性。我想知道如何增加图例和主图之间的间距。
按照您提供的链接中的示例:
library(ggplot2) 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))
plot <- plot + theme(legend.box.margin = margin(0, 0, 0, 20))