I am trying to change the opacity of a ggplot graph plot. Consider the following example:
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")
This gives the following graph:

In fact, although source_x and source_y are estimates during the current period, they are true values ββin the past. Therefore, I want to change the opacity of only the blue and green parts in the left sidebar. It can be done? How?
source
share