Book Image

Python Data Analysis

By : Ivan Idris
Book Image

Python Data Analysis

By: Ivan Idris

Overview of this book

Table of Contents (22 chapters)
Python Data Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Key Concepts
Online Resources
Index

Legends and annotations


Legends and annotations are effective tools to display information required to comprehend a plot in a glance. A typical plot will have the following additional information elements:

  • A legend describing the various data series in the plot. This is provided by invoking the matplotlib legend() function and supplying the labels for each data series.

  • Annotations for important points in the plot. The matplotlib annotate() function can be used for this purpose. A matplotlib annotation consists of a label and an arrow. This function has many parameters describing the label and arrow style and position, so you may need to call help(annotate) for a detailed description.

  • Labels on the horizontal and vertical axes. These labels can be drawn by the xlabel() and ylabel() functions. We need to give these functions the text of the labels as a string and optional parameters such as the font size of the label.

  • A descriptive title for the graph with the matplotlib title() function. Typically...