【发布时间】:2015-08-20 17:44:09
【问题描述】:
我想让我的情节中的图例水平并将其移动到右上角。那可能吗?
DF3 <- data.frame(
x = rnorm(100, mean = 0, sd = 1),
y = rnorm(n = 100, mean = 1, sd = 1),
shape = sample(
x = c('circle', 'square'), size = 100, replace = T, prob = c(.5,.5)
),
Precision = runif(n = 100, min = 0.1, max = 1)
)
library(ggplot2)
DF3 %>%
ggplot(aes(
x = x, y = y, color = Precision, size = 2, shape = shape
)) +
geom_point(show_guide = TRUE) +
theme_bw()+
scale_colour_gradient(low = "#f7fbff", high = "#08306b") + guides(shape = "none", size="none")
【问题讨论】:
-
+ theme(legend.direction="horizontal", legend.position=c(0.85, 0.9)) -
@hrbrmstr 谢谢!有可能把它放在情节之外吗?