I'd like to create a ggplot
which use two variables to fill in different way. Based on this solution I made
x = c("Band 1", "Band 2", "Band 3")
y1 = c("1","2","3")
y2 = c("2","3","4")
to_plot <- data.frame(x=x,y1=y1,y2=y2)
melted<-melt(to_plot, id="x")
ggplot(melted,aes(x=x,y=value,fill=variable)) +
geom_bar(stat="identity",position = "identity", alpha=.3)
but instead of alpha
parameter, I'd like to color each Band
value in different way and implement y1
as white bar with border in color of a given Band
and y2
as bar with color of of a given Band
. How to do it?