What we will learn
Know your problem
Know your data
Visualize your data - bar chart
11. Plot the bar chart
Work with your chart
Check yourself


Now let's build a bar chart. You've already done this, so we won't go into any explanations here. Remember to remove the vertical grid lines after you have plotted the chart. They are completely redundant here.


Create a bar chart for zimbabwe_consumption. Use the year column as the x variable and the consumption column as the y variable. Add the theme() function with the panel.grid.major.x and panel.grid.minor.x elements set to element_blank().

Stuck? Here's a hint!

You should write:

bar <- ggplot(
    data = zimbabwe_consumption, 
    aes(x = year, y = consumption)) + 
  geom_col() + 
    panel.grid.major.x = element_blank(), 
    panel.grid.minor.x = element_blank())