使用
这很奇怪,因为
以下是一些玩具数据。
ggplot2
的 legend.position
(和 legend.justification
)这两个可用参数指示图例的相对位置,但如果我想根据绘图坐标来定位图例呢?我找不到方法。这很奇怪,因为
annotate
提供了一个允许这样做的 x 和 y 参数。以下是一些玩具数据。
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg,y = disp,color = factor(cyl))) +
geom_point() +
theme(legend.position = c(0.01,0.01),
legend.justification = c(0,0))
翻译结果:
这意味着:{{link1:}}
如果我想要图例的左下角坐标为(10,100),怎么办?