To fully document your graph, you usually have to resort to labels, annotations, and legends. Each of these elements has a different purpose, as follows:
Label: Make it easy for the viewer to know the name or kind of data illustrated
Annotation: Help extend the viewer's knowledge of the data, rather than simply identify it.
Legend: Provides cues to make identification of the data group easier.
Labels help people understand the significance of each axis of any graph you create.
We will add label to the last example in previous section.
The call to xlabel() documents the x axis of your graph, while the call the ylabel() documents the y axis of your graph.You use annotation to draw special attention to points of interest on a graph.
Here, we will annotate "Highest in 2015" in Sep 2015.
Inside the annotate method, xy=[9,5] denote that you are putting the annotation on x-axis of 9 (Sep), and y-axis of 5.A legend documents the individual elements of a plot.
Here, we will tell that the blue line is from 2005 and the cyan line is from 2015.
In the legend, loc=1 means to put the legend in top-right corner. Try change the number to 2, 3, and 4. See the difference.Using airtravel.csv again, extends the code you made in Exercise 2.1 by adding the following changes:
Add appropriate labels for x and y axis.
You want to explain why the flight on July is high and November is low. Add an arrow pointing to the top of July and November, with annotation saying "Summer Holiday" in July and "Thanksgiving" in November (for 1960 flight).
Find a way to change the facecolor of the axes to be light grey, then change the grid color to be white.
Add the legend in the top-left corner with no frame
Make the legend background transparent (not white).