Title and legend are pieces of text that facilitate quick comprehension of the data context. Although a title is not required or recommended, sometimes, such as in inline figures of many scientific publications, adding a title for your plot often helps make the message clear, especially when your figure is not accompanied by explanatory text. For plots with multiple datasets, it is a good practice to keep a data legend with a distinct color or pattern code labeled with the corresponding identities.
Title and legend
Adding a title to your figure
The title of a figure can be set by pyplot.title() or axes.set_title(). Text properties can be supplied as keyword arguments.