Only this week, get the SQL Complete Track of 9 courses in a special prize of $330 $89!
What we will learn
Know your problem
Know your data
Visualize your data - bar chart
Work with your chart
15. Add source and title information
Check yourself


Always include information about your data source in your chart. It gives credibility to your work and provides context for the story. A caption noting the source of your data should be located under the chart. It's usually written in a smaller font.

To do that in ggplot2, use the labs() function with the argument caption:

+ labs(caption="Source: your source")


Add source information to your chart as described above. Instead of Source: your source write Source: WHO. And of course, every chart needs a good title. Add one to this chart, using labs with the title argument. Your title might be "Alcohol consumption in Zimbabwe [liters per capita]". Save the changed chart to the bar object. When you're done, press Run and Check Code to check your code.

Stuck? Here's a hint!

You should write:

  caption = "Source: WHO", 
  title = "Alcohol consumption in Zimbabwe [litres per capita]")