Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Visualize your data
Work with your chart 2
13. Add a chart title
Check yourself

Instruction

Always add a title to your chart! Remember that not everyone will know what is presented on it.

Look at our chart. Is it obvious what the subject is (in other words, what distribution is being visualized)? Is this the distribution of alcohol consumption or apple consumption? In what place? In the world or maybe just in Brazil? Would you know the answers without seeing the data? Probably not. That's why you should always add a title to your chart – it helps describe it.

Your title should be in the left corner above the chart and contain information about its subject, variables, and any units used. If you plan to place unit info on the axes, as we will do later, you don't have to list units in the title. Instead, you can make your main chart title less formal and more catchy. For example, you may use it to ask a question about the data.

To add a title to your chart, add this command to your plot:

+labs(title = "some title")

Exercise

Add a title to the plot using above labs command. Change "some title" to your own title. If you want, you can use ours: "How much alcohol is consumed worldwide?". Save the plot again to the hist object.

Stuck? Here's a hint!

You should write:

labs(title = "How much alcohol is consumed worldwide?")