Skip to content
Prev 388816 / 398502 Next

Help needed in double bar plot made using ggplot2

Hello,

Glad it helped.

As for making everything red, that only happens with the 2nd geom_text I 
posted. And this is because color = "red" is not in aes().

In the 1st geom_text, I have aes( etc , color = gender)
and this makes the color depend on gender.

To make the text and bars colors the same, put color = gender in the 
initial call to ggplot. Like this, all geom_ (layers) will inherit that 
aesthetic.

And you don't need group = gender, fill or color already group the data.


ggplot(aes(x=year, y=percentage, fill=gender, color=gender), data = 
graph_text)+
   rest_of_code


Hope this helps,

Rui Barradas

?s 21:35 de 19/08/21, bharat rawlley escreveu: