【发布时间】:2017-03-14 01:13:38
【问题描述】:
我正在尝试更改 ggplot 条形图的不透明度。考虑以下示例:
df <- data.frame(period = rep(c("current", "past"), 3),
type = c("so_far", "so_far", "source_x", "source_x", "source_y", "source_y"),
income = c(12, 10, 7, 9, 4, 7))
ggplot(df, aes(x = period, y = income, fill = type)) + geom_bar(stat = "identity")
实际上,尽管当前时期的 source_x 和 source_y 是估计值,而在过去它们是真实值。所以我想改变左侧栏上蓝色和绿色部分的不透明度。 这可以做到吗?怎么样?
【问题讨论】: