【发布时间】:2018-06-19 08:22:53
【问题描述】:
在我的脑海中,这确实是一个简单的调整,但我找不到一个简单的论据来做到这一点。我希望标题不在此图的顶部,而是在底部。我可以使用任何文本行来快速高效地做到这一点吗?
library(tidyverse)
set.seed(20)
df <- data.frame(expl = rbinom(n=100, size = 1, prob=0.08),
resp = sample(50:100, size = 100, replace = T))
df$expl <- factor(df$expl, levels = c("1", "0"))
ggplot(df, aes(x = resp, alpha = factor(expl, labels = c("Condition 1", "Condition 2")))) +
geom_histogram(fill = "#bebada", bins = 10) +
labs(title = "I want this title to the bottom of the graph") +
labs(alpha = "Condition") +
scale_alpha_manual(values = c(0.5, 1))
【问题讨论】:
-
请参阅this answer 了解一些选项,例如使用
caption而不是title。