My geom bar wont change colors: Please help: where is the error


df<- df %>% filter(str_detect(ComplaintType, "HEATING")) %>%
mutate(month = month.abb[month(mdy_hms(CreatedDate))]) %>%
  filter(!is.na(month))

monthly_complaints <- df%>%

group_by(month)%>%

summarise(count = n()) %>%

arrange(desc(count))

monthly_complaints$month = factor(monthly_complaints$month,levels = month.abb)

ggplot(monthly_complaints,aes(x=month,y=count))+geom_bar(stat='identity',fill='#f68060', alpha=.6, width=.4)+geom_col(position = "dodge") +labs(
    title = " Heat Complaints Against Months of Top Boroughs",
    y="Month", x="Complaint Count")



We are limited in how we can help without access to monthly_complaints.

Are you able to provide a reproducible example?

you add 2 sets of the bars, one with geom_bar() where you define the appearance and one with geom_col() where you don't. I guess the second one just overlayes the first one (as you don't define something to dodge) and with that you don't see the changes.
Try again without the geom_col().

1 Like

Thank you very much, Matthias. I appreciate the help!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.