3.7.1 Axes images ........................................... 36
3.7.2 Figure images ........................................... 38
3.7.3 Scaling and color mapping .................................... 38
3.7.4 Image origin ........................................... 39
3.8 Bar charts, histograms and errorbar plots ................................. 40
3.8.1 Broken bar charts ......................................... 40
3.9 Polar charts ................................................ 41
3.10 Pseudocolor and scatter plots ....................................... 43
3.11 Spectral analysis ............................................. 43
3.12 Axes properties .............................................. 45
3.13 Legends and tables ............................................ 45
3.14 Navigation ................................................. 45
3.14.1 Classic toolbar .......................................... 45
3.14.2 toolbar2 .............................................. 45
3.15 Event handling .............................................. 46
3.16 Customizing plot defaults ......................................... 48
4 Font finding and properties 49
5 Collections 53
6 Tick locators and formatters 55
6.1 Tick locating ............................................... 55
6.2 Tick formatting .............................................. 56
6.3 Example 1: major and minor ticks .................................... 56
6.4 Example 2: date ticking .......................................... 58
7 Interactive object picking 61
7.1 Picking with a lasso tool ......................................... 63
8 Custom objects and units 67
9 Cookbook 73
9.1 Plot elements ............................................... 73
9.1.1 Horizontal or vertical lines/spans ................................. 73
9.1.2 Fill the area between two curves ................................. 73
9.1.3 Drawing true ellipses and circles ................................. 73
9.2 Text .................................................... 74
9.2.1 Adding a ylabel on the right of the axes ............................. 74
9.3 Data analysis ............................................... 75
9.3.1 Linear regression ......................................... 75
9.3.2 Polynomial regression ...................................... 76
9.4 Working with images ........................................... 77
9.4.1 Loading existing images into matplotlib ............................. 77
9.4.2 Blending several axes images using alpha ............................ 78
9.4.3 Creating a mosaic of images ................................... 79
9.4.4 Defining your own colormap ................................... 80
9.5 Output ................................................... 80
9.5.1 Printing to standard output .................................... 80
4