'Legend wont display in stacked bar graph where the 2 series of values are numerical
I have a stacked bar graph with 2 numerical values and the bars are stacked on top of eachother. I would like to display a Legend that indicates the description of the 2 colors. Here it is my code but its not displaying. Any help from anyone I would be greatful for.
ggplot(data=my_data, aes(x = Xaxis)) +
ggtitle("My Title")+
theme(plot.title = element_text(hjust = 0.5, face="bold"))+
geom_col(aes(y = v1), fill ="red")+
geom_col(aes(y = v2), fill="blue")+
labs(y= "Amount", color ="Legend")+
theme(legend.title = element_text(color='black',face='bold'),
legend.text = element_text(color='black',face='bold'))+
scale_y_continuous(labels = comma)
From the above code the legend does not display
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
