Bar plots: sequential color palette
In this bar plot, we'll fill each segment according to an ordinal variable. The best way to do that is with a sequential color palette.
Here's an example of using a sequential color palette with the mtcars
dataset:
ggplot(mtcars, aes(fcyl, fill = fam)) +
geom_bar() +
scale_fill_brewer(palette = "Set1")
In the exercise, you'll use similar code on the the Vocab
dataset. Both datasets are ordinal.
This exercise is part of the course
Introduction to Data Visualization with ggplot2
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot education, filled by vocabulary
___