[Solved] Change color of outline in multicolored grouped barplot


I really recommend taking a look at the documentation for geom_bar() (as well as the basic ggplot2 documentation), but this might help get you started.

You can add an outline to your bars by using colour = "black", and you can change the axis labels by using labs(). We use the arguments within theme() to change the font size on your axis labels and tickmarks. See the code below:

# example dataframe
df <- data.frame(time = factor(c("Lunch","Dinner"), levels=c("Lunch","Dinner")),
                 total_bill = c(14.89, 17.23))

plot <- ggplot(data = df, aes(x = time, y = total_bill, fill = time)) +
        geom_bar(colour = "black", stat = "identity") +
        labs(x = "Meal", y = "Total Bill") +
        theme(axis.title.x = element_text(size = 13, face = "bold"),
              axis.title.y = element_text(size = 13, face = "bold"),
              axis.text.x = element_text(size = 12),
              axis.text.y = element_text(size = 12))
print(plot)

enter image description here

solved Change color of outline in multicolored grouped barplot