I want to overlay 3 geom_bar to make clear an evolution over 3 years. My data is as follows for each year:
Example : PerfDist2021 (my dataframe for 2021)
Districts | Perf |
---|---|
1 | 40 |
2 | 30 |
3 | 60 |
On my Yaxis I have the performance (in %) and on the Xaxis I have the number corresponding to the district (from 1 to 25 and there is also a 31th).
I made this :
ggplot(data=NULL, aes(Districts, Perf)) +
geom_bar(aes(fill = "2019"), data = PerfDist2019, stat="identity" ,alpha = 0.5, col="red") +
geom_bar(aes(fill = "2020" ), data = PerfDist2020, stat="identity", alpha = 0.5, col="green") +
geom_bar(aes(fill = "2021" ), data = PerfDist2021, stat="identity", alpha = 0.5, col="blue")
But first, I can't see all my districts, I don't know how to get them all visible it's like R erase some or is just not precise with my Xaxis (see picture in link).
Secondly, I don't know how to change the color of the geom_bar, I can just change the color of the frame of the bar with col=... , and the data is not very readable this way.
Third, the colours blend together, it is sometimes hard to distinguish the three. I tried with several combination of colors, it is always the same. Is there a way to avoir this issue of mixing colors ? Thanks you
Thanks you for your help !
PS : You can ask for any precision !