fcyl <- factor(mtcars$cyl)
fam <- factor(mtcars$am)
palette <- c(automatic = "#377EB8", manual = "#E41A1C")
ggplot(mtcars, aes(fcyl, fill = fam)) +
geom_bar() +
labs(x = "Number of Cylinders", y = "Count") +
# Set the fill color scale
scale_fill_manual("Transmission", values = palette)
I don't understand the last line. What is Transmission? What is values = palette?