Re: [R] Help needed in double bar plot made using ggplot2

2021-08-20 Thread ken
Thanks Dr. Burradas too. i also had the same question. regards August 20, 2021 6:02 AM, "bharat rawlley via R-help" wrote: > Thank you, Dr. Burradas! > That resolved my query > Have a great rest of your day > On Thursday, 19 August, 2021, 04:47:42 pm GMT-4, Rui Barradas > wrote: > __

Re: [R] Help needed in double bar plot made using ggplot2

2021-08-19 Thread bharat rawlley via R-help
Thank you, Dr. Burradas!  That resolved my query Have a great rest of your day On Thursday, 19 August, 2021, 04:47:42 pm GMT-4, Rui Barradas wrote: 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

Re: [R] Help needed in double bar plot made using ggplot2

2021-08-19 Thread Rui Barradas
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 s

Re: [R] Help needed in double bar plot made using ggplot2

2021-08-19 Thread bharat rawlley via R-help
Thank you very much for the elaborate response, Dr. Barradas! It was extremely helpful!  This resolves all my queries except one; I am unable to assign aesthetic colors in a way that the bar and text colors remain the same. I am not sure how to exactly assign color outside of aes. I used the fo

Re: [R] Help needed in double bar plot made using ggplot2

2021-08-19 Thread Rui Barradas
Hello, First, sample data. set.seed(2021) year <- rep(2016:2019, 2) percentage <- runif(length(year), 0.25, 0.70) gender <- rep(c("M", "F"), each = 4) graph_text <- data.frame(year, percentage, gender) 1) You have expand = c(0,0). Like this there is no space above the greatest bar. In order t