I have the following data: [example from R graphics Cookbook]
Cultivar Date Weight sd n se big
c39 d16 3.18 0.9566144 10 0.30250803
The problem here is that your variable is discrete, whereas the alpha
scale is continuous. One way to do it is to manually compute your alpha values before plotting :
alpha <- ifelse(d$big, 0.9, 0.35)
ggplot(d, aes(x=Date, y=Weight, fill=Cultivar)) +
geom_bar(position="dodge", stat="identity", aes(alpha=alpha))
The downside is that you won't get a correct legend for your alpha values. You can delete it with this :
ggplot(d, aes(x=Date, y=Weight, fill=Cultivar)) +
geom_bar(position="dodge", stat="identity", aes(alpha=big)) +
scale_alpha_continuous(guide=FALSE)
Final result :