Matplotlib Fix1 Itebooks PDF Download
Matplotlib Fix1 Itebooks PDF Download
https://ebookbell.com/product/matplotlib-fix1-itebooks-23837102
https://ebookbell.com/product/matplotlib-for-python-developers-tosi-
sandro-22091690
https://ebookbell.com/product/matplotlib-plotting-cookbook-alexandre-
devert-4952424
https://ebookbell.com/product/matplotlib-2-by-example-allen-yu-claire-
chung-aldrin-yim-6723604
https://ebookbell.com/product/matplotlib-for-python-developers-
effective-techniques-for-data-visualization-with-python-2nd-edition-
aldrin-chung-claire-yu-allen-yim-11144400
Matplotlib 30 Cookbook 1st Edition Srinivasa Rao Poladi
https://ebookbell.com/product/matplotlib-30-cookbook-1st-edition-
srinivasa-rao-poladi-7265678
https://ebookbell.com/product/matplotlib-for-python-developers-2nd-
edition-yu-allen-chung-61234388
https://ebookbell.com/product/mastering-matplotlib-with-python-for-
developers-effective-techniques-for-data-visualization-with-python-
melendez-58304706
https://ebookbell.com/product/mastering-matplotlib-duncan-m-
mcgreggor-42932608
https://ebookbell.com/product/python-and-matplotlib-essentials-for-
scientists-and-engineers-matt-a-wood-36155290
Matplotlib
Release 1.5.1
John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the ma
1 Colormap 3
2 Everything Else 5
II User’s Guide 7
3 Introduction 9
4 Configuration Guide 11
4.1 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Customizing matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 Using matplotlib in a python shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5 Beginner’s Guide 29
5.1 Pyplot tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 Customizing plots with style sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.3 Interactive navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.4 Working with text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.5 Image tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.6 Legend guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.7 Annotating Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.8 Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.9 Choosing Colormaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.10 Colormap Normaliztions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
i
7 What’s new in matplotlib 233
7.1 new in matplotlib-1.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
7.2 new in matplotlib-1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
7.3 new in matplotlib-1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
7.4 new in matplotlib 1.2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
7.5 new in matplotlib-1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
7.6 new in matplotlib-1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
7.7 new in matplotlib-1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
7.8 new in matplotlib-0.99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
7.9 new in 0.98.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9 License 365
9.1 Copyright Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.2 License agreement for matplotlib 1.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.3 License agreement for matplotlib versions prior to 1.3.0 . . . . . . . . . . . . . . . . . . . 366
10 Credits 369
11 Installation 375
11.1 Report a compilation problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
11.2 matplotlib compiled fine, but nothing shows up when I use it . . . . . . . . . . . . . . . . . 375
11.3 How to completely remove matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
11.4 How to Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
11.5 Linux Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
11.6 OS-X Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
11.7 Windows Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
12 Usage 383
12.1 General Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
12.2 Parts of a Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
12.3 Types of inputs to plotting functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
12.4 Matplotlib, pyplot and pylab: how are they related? . . . . . . . . . . . . . . . . . . . . . . 386
12.5 Coding Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
12.6 What is a backend? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
12.7 WX backends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
12.8 GTK and Cairo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
12.9 How do I select PyQt4 or PySide? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
12.10 What is interactive mode? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
13 How-To 395
13.1 Plotting: howto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
13.2 Contributing: howto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
13.3 Matplotlib in a web application server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
13.4 Search examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
ii
13.5 Cite Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
14 Troubleshooting 409
14.1 Obtaining matplotlib version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
14.2 matplotlib install location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
14.3 matplotlib configuration and cache directory locations . . . . . . . . . . . . . . . . . . . 409
14.4 Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
14.5 Problems with recent git versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
18 Videos 423
19 Tutorials 425
22 Licenses 439
22.1 Why BSD compatible? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
iii
23.5 git resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
23.6 Making a patch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
24 Testing 455
24.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
24.2 Running the tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
24.3 Writing a simple test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
24.4 Writing an image comparison test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
24.5 Freetype version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
24.6 Known failing tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
24.7 Creating a new module in matplotlib.tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
24.8 Using Travis CI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
24.9 Using tox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
iv
30.3 MEP9: Global interaction manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
30.4 MEP10: Docstring consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
30.5 MEP11: Third-party dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
30.6 MEP12: Improve Gallery and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
30.7 MEP12: Use properties for Artists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
30.8 MEP13: Text handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
30.9 MEP15 - Fix axis autoscaling when limits are specified for one axis only . . . . . . . . . . 541
30.10 MEP19: Continuous Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
30.11 MEP21: color and cm refactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
30.12 MEP22: Toolbar rewrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
30.13 MEP23: Multiple Figures per GUI window . . . . . . . . . . . . . . . . . . . . . . . . . . 551
30.14 MEP24: negative radius in polar plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
30.15 MEP25: Serialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
30.16 MEP26: Artist styling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
30.17 MEP27: decouple pyplot from backends . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
v
36.1 Basemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
36.2 Cartopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
vi
40.24 Changes for 0.73 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
40.25 Changes for 0.72 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
40.26 Changes for 0.71 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
40.27 Changes for 0.70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
40.28 Changes for 0.65.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
40.29 Changes for 0.65 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
40.30 Changes for 0.63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
40.31 Changes for 0.61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
40.32 Changes for 0.60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
40.33 Changes for 0.54.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
40.34 Changes for 0.54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
40.35 Changes for 0.50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
40.36 Changes for 0.42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
40.37 Changes for 0.40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
43 animation 867
43.1 matplotlib.animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
44 artists 875
44.1 matplotlib.artist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
45 axes 887
45.1 matplotlib.axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
46 axis 1079
46.1 matplotlib.axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079
47 backends 1089
47.1 matplotlib.backend_bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
47.2 matplotlib.backend_managers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1108
47.3 matplotlib.backend_tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1111
47.4 matplotlib.backends.backend_gtkagg . . . . . . . . . . . . . . . . . . . . . . . . . 1120
47.5 matplotlib.backends.backend_qt4agg . . . . . . . . . . . . . . . . . . . . . . . . . 1120
47.6 matplotlib.backends.backend_wxagg . . . . . . . . . . . . . . . . . . . . . . . . . . 1120
47.7 matplotlib.backends.backend_pdf . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121
48 cbook 1125
48.1 matplotlib.cbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1125
49 cm (colormap) 1141
49.1 matplotlib.cm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141
50 collections 1145
50.1 matplotlib.collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145
vii
51 colorbar 1305
51.1 matplotlib.colorbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1305
52 colors 1311
52.1 matplotlib.colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1311
53 dates 1323
53.1 matplotlib.dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1323
54 dviread 1335
54.1 matplotlib.dviread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1335
55 figure 1339
55.1 matplotlib.figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339
56 finance 1361
56.1 matplotlib.finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
57 font_manager 1371
57.1 matplotlib.font_manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1371
57.2 matplotlib.fontconfig_pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1377
58 gridspec 1379
58.1 matplotlib.gridspec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1379
59 image 1383
59.1 matplotlib.image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1383
60 Legend 1389
60.1 matplotlib.legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1389
60.2 matplotlib.legend_handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1392
61 lines 1397
61.1 matplotlib.lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1397
62 Markers 1407
62.1 matplotlib.markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1407
63 mathtext 1411
63.1 matplotlib.mathtext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1413
64 mlab 1429
64.1 matplotlib.mlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1429
65 offsetbox 1459
65.1 matplotlib.offsetbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1459
66 patches 1471
66.1 matplotlib.patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1471
viii
67 path 1511
67.1 matplotlib.path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511
68 patheffects 1519
68.1 matplotlib.patheffects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1519
69 pyplot 1523
69.1 matplotlib.pyplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1523
70 sankey 1709
70.1 matplotlib.sankey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1709
71 spines 1717
71.1 matplotlib.spines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1717
72 style 1721
72.1 matplotlib.style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1721
73 text 1723
73.1 matplotlib.text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723
74 ticker 1737
74.1 matplotlib.ticker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1737
75 tight_layout 1747
75.1 matplotlib.tight_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1747
77 type1font 1761
77.1 matplotlib.type1font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1761
78 units 1763
78.1 matplotlib.units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1763
79 widgets 1765
79.1 matplotlib.widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1765
ix
80.8 animation example code: histogram.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1788
80.9 animation example code: moviewriter.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 1789
80.10 animation example code: rain.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
80.11 animation example code: random_data.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 1791
80.12 animation example code: simple_3danim.py . . . . . . . . . . . . . . . . . . . . . . . . . 1792
80.13 animation example code: simple_anim.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 1793
80.14 animation example code: strip_chart_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 1794
80.15 animation example code: subplots.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1795
80.16 animation example code: unchained.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797
x
81.38 api example code: watermark_text.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1887
xi
84.16 event_handling example code: test_mouseclicks.py . . . . . . . . . . . . . . . . . . . . . . 1978
84.17 event_handling example code: timers.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 1978
84.18 event_handling example code: trifinder_event_demo.py . . . . . . . . . . . . . . . . . . . 1979
84.19 event_handling example code: viewlims.py . . . . . . . . . . . . . . . . . . . . . . . . . . 1980
84.20 event_handling example code: zoom_window.py . . . . . . . . . . . . . . . . . . . . . . . 1982
xii
88.5 mplot3d example code: contour3d_demo3.py . . . . . . . . . . . . . . . . . . . . . . . . . 2037
88.6 mplot3d example code: contourf3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2038
88.7 mplot3d example code: contourf3d_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . 2039
88.8 mplot3d example code: custom_shaded_3d_surface.py . . . . . . . . . . . . . . . . . . . . 2040
88.9 mplot3d example code: hist3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2042
88.10 mplot3d example code: lines3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 2043
88.11 mplot3d example code: lorenz_attractor.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2044
88.12 mplot3d example code: mixed_subplots_demo.py . . . . . . . . . . . . . . . . . . . . . . 2046
88.13 mplot3d example code: offset_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2048
88.14 mplot3d example code: pathpatch3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2049
88.15 mplot3d example code: polys3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 2051
88.16 mplot3d example code: quiver3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2052
88.17 mplot3d example code: rotate_axes3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2053
88.18 mplot3d example code: scatter3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2054
88.19 mplot3d example code: subplot3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2055
88.20 mplot3d example code: surface3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2057
88.21 mplot3d example code: surface3d_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . . 2058
88.22 mplot3d example code: surface3d_demo3.py . . . . . . . . . . . . . . . . . . . . . . . . . 2059
88.23 mplot3d example code: surface3d_radial_demo.py . . . . . . . . . . . . . . . . . . . . . . 2060
88.24 mplot3d example code: text3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2061
88.25 mplot3d example code: tricontour3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2063
88.26 mplot3d example code: tricontourf3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2064
88.27 mplot3d example code: trisurf3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2066
88.28 mplot3d example code: trisurf3d_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2067
88.29 mplot3d example code: wire3d_animation_demo.py . . . . . . . . . . . . . . . . . . . . . 2070
88.30 mplot3d example code: wire3d_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071
88.31 mplot3d example code: wire3d_zero_stride.py . . . . . . . . . . . . . . . . . . . . . . . . 2074
xiii
90.15 pylab_examples example code: axes_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2119
90.16 pylab_examples example code: axes_props.py . . . . . . . . . . . . . . . . . . . . . . . . 2120
90.17 pylab_examples example code: axes_zoom_effect.py . . . . . . . . . . . . . . . . . . . . . 2122
90.18 pylab_examples example code: axhspan_demo.py . . . . . . . . . . . . . . . . . . . . . . 2125
90.19 pylab_examples example code: axis_equal_demo.py . . . . . . . . . . . . . . . . . . . . . 2126
90.20 pylab_examples example code: bar_stacked.py . . . . . . . . . . . . . . . . . . . . . . . . 2128
90.21 pylab_examples example code: barb_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2129
90.22 pylab_examples example code: barchart_demo.py . . . . . . . . . . . . . . . . . . . . . . 2132
90.23 pylab_examples example code: barchart_demo2.py . . . . . . . . . . . . . . . . . . . . . . 2134
90.24 pylab_examples example code: barcode_demo.py . . . . . . . . . . . . . . . . . . . . . . 2138
90.25 pylab_examples example code: boxplot_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2139
90.26 pylab_examples example code: boxplot_demo2.py . . . . . . . . . . . . . . . . . . . . . . 2147
90.27 pylab_examples example code: boxplot_demo3.py . . . . . . . . . . . . . . . . . . . . . . 2150
90.28 pylab_examples example code: break.py . . . . . . . . . . . . . . . . . . . . . . . . . . . 2152
90.29 pylab_examples example code: broken_axis.py . . . . . . . . . . . . . . . . . . . . . . . . 2153
90.30 pylab_examples example code: broken_barh.py . . . . . . . . . . . . . . . . . . . . . . . . 2155
90.31 pylab_examples example code: centered_ticklabels.py . . . . . . . . . . . . . . . . . . . . 2156
90.32 pylab_examples example code: cohere_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2158
90.33 pylab_examples example code: color_by_yvalue.py . . . . . . . . . . . . . . . . . . . . . 2159
90.34 pylab_examples example code: color_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2160
90.35 pylab_examples example code: colorbar_tick_labelling_demo.py . . . . . . . . . . . . . . 2162
90.36 pylab_examples example code: colours.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2164
90.37 pylab_examples example code: contour_corner_mask.py . . . . . . . . . . . . . . . . . . . 2165
90.38 pylab_examples example code: contour_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2167
90.39 pylab_examples example code: contour_image.py . . . . . . . . . . . . . . . . . . . . . . 2175
90.40 pylab_examples example code: contour_label_demo.py . . . . . . . . . . . . . . . . . . . 2178
90.41 pylab_examples example code: contourf_demo.py . . . . . . . . . . . . . . . . . . . . . . 2182
90.42 pylab_examples example code: contourf_hatching.py . . . . . . . . . . . . . . . . . . . . . 2187
90.43 pylab_examples example code: coords_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2189
90.44 pylab_examples example code: coords_report.py . . . . . . . . . . . . . . . . . . . . . . . 2191
90.45 pylab_examples example code: csd_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2192
90.46 pylab_examples example code: cursor_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2193
90.47 pylab_examples example code: custom_cmap.py . . . . . . . . . . . . . . . . . . . . . . . 2197
90.48 pylab_examples example code: custom_figure_class.py . . . . . . . . . . . . . . . . . . . 2202
90.49 pylab_examples example code: custom_ticker1.py . . . . . . . . . . . . . . . . . . . . . . 2203
90.50 pylab_examples example code: customize_rc.py . . . . . . . . . . . . . . . . . . . . . . . 2204
90.51 pylab_examples example code: dashpointlabel.py . . . . . . . . . . . . . . . . . . . . . . . 2206
90.52 pylab_examples example code: data_helper.py . . . . . . . . . . . . . . . . . . . . . . . . 2207
90.53 pylab_examples example code: date_demo1.py . . . . . . . . . . . . . . . . . . . . . . . . 2209
90.54 pylab_examples example code: date_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . 2211
90.55 pylab_examples example code: date_demo_convert.py . . . . . . . . . . . . . . . . . . . . 2213
90.56 pylab_examples example code: date_demo_rrule.py . . . . . . . . . . . . . . . . . . . . . 2214
90.57 pylab_examples example code: date_index_formatter.py . . . . . . . . . . . . . . . . . . . 2216
90.58 pylab_examples example code: demo_agg_filter.py . . . . . . . . . . . . . . . . . . . . . . 2218
90.59 pylab_examples example code: demo_annotation_box.py . . . . . . . . . . . . . . . . . . 2225
90.60 pylab_examples example code: demo_bboximage.py . . . . . . . . . . . . . . . . . . . . . 2227
90.61 pylab_examples example code: demo_ribbon_box.py . . . . . . . . . . . . . . . . . . . . . 2229
90.62 pylab_examples example code: demo_text_path.py . . . . . . . . . . . . . . . . . . . . . . 2232
xiv
90.63 pylab_examples example code: demo_text_rotation_mode.py . . . . . . . . . . . . . . . . 2236
90.64 pylab_examples example code: demo_tight_layout.py . . . . . . . . . . . . . . . . . . . . 2238
90.65 pylab_examples example code: dolphin.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2248
90.66 pylab_examples example code: ellipse_collection.py . . . . . . . . . . . . . . . . . . . . . 2251
90.67 pylab_examples example code: ellipse_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2252
90.68 pylab_examples example code: ellipse_rotated.py . . . . . . . . . . . . . . . . . . . . . . 2253
90.69 pylab_examples example code: equal_aspect_ratio.py . . . . . . . . . . . . . . . . . . . . 2254
90.70 pylab_examples example code: errorbar_limits.py . . . . . . . . . . . . . . . . . . . . . . 2255
90.71 pylab_examples example code: errorbar_subsample.py . . . . . . . . . . . . . . . . . . . . 2257
90.72 pylab_examples example code: eventcollection_demo.py . . . . . . . . . . . . . . . . . . . 2259
90.73 pylab_examples example code: eventplot_demo.py . . . . . . . . . . . . . . . . . . . . . . 2261
90.74 pylab_examples example code: fancyarrow_demo.py . . . . . . . . . . . . . . . . . . . . . 2263
90.75 pylab_examples example code: fancybox_demo.py . . . . . . . . . . . . . . . . . . . . . . 2265
90.76 pylab_examples example code: fancybox_demo2.py . . . . . . . . . . . . . . . . . . . . . 2269
90.77 pylab_examples example code: fancytextbox_demo.py . . . . . . . . . . . . . . . . . . . . 2270
90.78 pylab_examples example code: figimage_demo.py . . . . . . . . . . . . . . . . . . . . . . 2271
90.79 pylab_examples example code: figlegend_demo.py . . . . . . . . . . . . . . . . . . . . . . 2273
90.80 pylab_examples example code: figure_title.py . . . . . . . . . . . . . . . . . . . . . . . . 2274
90.81 pylab_examples example code: fill_between_demo.py . . . . . . . . . . . . . . . . . . . . 2275
90.82 pylab_examples example code: fill_betweenx_demo.py . . . . . . . . . . . . . . . . . . . 2279
90.83 pylab_examples example code: fill_spiral.py . . . . . . . . . . . . . . . . . . . . . . . . . 2282
90.84 pylab_examples example code: finance_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2283
90.85 pylab_examples example code: finance_work2.py . . . . . . . . . . . . . . . . . . . . . . 2285
90.86 pylab_examples example code: findobj_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2290
90.87 pylab_examples example code: font_table_ttf.py . . . . . . . . . . . . . . . . . . . . . . . 2291
90.88 pylab_examples example code: fonts_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2293
90.89 pylab_examples example code: fonts_demo_kw.py . . . . . . . . . . . . . . . . . . . . . . 2296
90.90 pylab_examples example code: ganged_plots.py . . . . . . . . . . . . . . . . . . . . . . . 2298
90.91 pylab_examples example code: geo_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2300
90.92 pylab_examples example code: ginput_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2301
90.93 pylab_examples example code: ginput_manual_clabel.py . . . . . . . . . . . . . . . . . . 2301
90.94 pylab_examples example code: gradient_bar.py . . . . . . . . . . . . . . . . . . . . . . . . 2304
90.95 pylab_examples example code: griddata_demo.py . . . . . . . . . . . . . . . . . . . . . . 2305
90.96 pylab_examples example code: hatch_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2306
90.97 pylab_examples example code: hexbin_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2308
90.98 pylab_examples example code: hexbin_demo2.py . . . . . . . . . . . . . . . . . . . . . . 2309
90.99 pylab_examples example code: hist2d_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2311
90.100pylab_examples example code: hist2d_log_demo.py . . . . . . . . . . . . . . . . . . . . . 2312
90.101pylab_examples example code: hist_colormapped.py . . . . . . . . . . . . . . . . . . . . . 2313
90.102pylab_examples example code: histogram_percent_demo.py . . . . . . . . . . . . . . . . . 2314
90.103pylab_examples example code: hyperlinks.py . . . . . . . . . . . . . . . . . . . . . . . . . 2315
90.104pylab_examples example code: image_clip_path.py . . . . . . . . . . . . . . . . . . . . . 2316
90.105pylab_examples example code: image_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2317
90.106pylab_examples example code: image_demo2.py . . . . . . . . . . . . . . . . . . . . . . . 2318
90.107pylab_examples example code: image_interp.py . . . . . . . . . . . . . . . . . . . . . . . 2319
90.108pylab_examples example code: image_masked.py . . . . . . . . . . . . . . . . . . . . . . 2323
90.109pylab_examples example code: image_nonuniform.py . . . . . . . . . . . . . . . . . . . . 2325
90.110pylab_examples example code: image_origin.py . . . . . . . . . . . . . . . . . . . . . . . 2327
xv
90.111pylab_examples example code: image_slices_viewer.py . . . . . . . . . . . . . . . . . . . 2328
90.112pylab_examples example code: interp_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2330
90.113pylab_examples example code: invert_axes.py . . . . . . . . . . . . . . . . . . . . . . . . 2331
90.114pylab_examples example code: layer_images.py . . . . . . . . . . . . . . . . . . . . . . . 2332
90.115pylab_examples example code: leftventricle_bulleye.py . . . . . . . . . . . . . . . . . . . 2333
90.116pylab_examples example code: legend_demo2.py . . . . . . . . . . . . . . . . . . . . . . 2338
90.117pylab_examples example code: legend_demo3.py . . . . . . . . . . . . . . . . . . . . . . 2339
90.118pylab_examples example code: legend_demo4.py . . . . . . . . . . . . . . . . . . . . . . 2340
90.119pylab_examples example code: legend_demo5.py . . . . . . . . . . . . . . . . . . . . . . 2341
90.120pylab_examples example code: line_collection.py . . . . . . . . . . . . . . . . . . . . . . 2343
90.121pylab_examples example code: line_collection2.py . . . . . . . . . . . . . . . . . . . . . . 2345
90.122pylab_examples example code: load_converter.py . . . . . . . . . . . . . . . . . . . . . . 2346
90.123pylab_examples example code: loadrec.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2347
90.124pylab_examples example code: log_bar.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2349
90.125pylab_examples example code: log_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2350
90.126pylab_examples example code: log_test.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2351
90.127pylab_examples example code: logo.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2352
90.128pylab_examples example code: major_minor_demo1.py . . . . . . . . . . . . . . . . . . . 2353
90.129pylab_examples example code: major_minor_demo2.py . . . . . . . . . . . . . . . . . . . 2355
90.130pylab_examples example code: manual_axis.py . . . . . . . . . . . . . . . . . . . . . . . . 2356
90.131pylab_examples example code: marker_path.py . . . . . . . . . . . . . . . . . . . . . . . . 2358
90.132pylab_examples example code: markevery_demo.py . . . . . . . . . . . . . . . . . . . . . 2359
90.133pylab_examples example code: masked_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2365
90.134pylab_examples example code: mathtext_demo.py . . . . . . . . . . . . . . . . . . . . . . 2366
90.135pylab_examples example code: mathtext_examples.py . . . . . . . . . . . . . . . . . . . . 2368
90.136pylab_examples example code: matplotlib_icon.py . . . . . . . . . . . . . . . . . . . . . . 2371
90.137pylab_examples example code: matshow.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2372
90.138pylab_examples example code: movie_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2374
90.139pylab_examples example code: mri_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2375
90.140pylab_examples example code: mri_with_eeg.py . . . . . . . . . . . . . . . . . . . . . . . 2376
90.141pylab_examples example code: multi_image.py . . . . . . . . . . . . . . . . . . . . . . . . 2378
90.142pylab_examples example code: multicolored_line.py . . . . . . . . . . . . . . . . . . . . . 2380
90.143pylab_examples example code: multiline.py . . . . . . . . . . . . . . . . . . . . . . . . . 2383
90.144pylab_examples example code: multipage_pdf.py . . . . . . . . . . . . . . . . . . . . . . . 2384
90.145pylab_examples example code: multiple_figs_demo.py . . . . . . . . . . . . . . . . . . . . 2385
90.146pylab_examples example code: multiple_yaxis_with_spines.py . . . . . . . . . . . . . . . 2387
90.147pylab_examples example code: nan_test.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2389
90.148pylab_examples example code: newscalarformatter_demo.py . . . . . . . . . . . . . . . . 2390
90.149pylab_examples example code: patheffect_demo.py . . . . . . . . . . . . . . . . . . . . . 2395
90.150pylab_examples example code: pcolor_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2397
90.151pylab_examples example code: pcolor_log.py . . . . . . . . . . . . . . . . . . . . . . . . . 2399
90.152pylab_examples example code: pcolor_small.py . . . . . . . . . . . . . . . . . . . . . . . 2400
90.153pylab_examples example code: pie_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . 2401
90.154pylab_examples example code: plotfile_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2403
90.155pylab_examples example code: polar_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2411
90.156pylab_examples example code: polar_legend.py . . . . . . . . . . . . . . . . . . . . . . . 2413
90.157pylab_examples example code: print_stdout.py . . . . . . . . . . . . . . . . . . . . . . . . 2414
90.158pylab_examples example code: psd_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2415
xvi
90.159pylab_examples example code: psd_demo2.py . . . . . . . . . . . . . . . . . . . . . . . . 2416
90.160pylab_examples example code: psd_demo3.py . . . . . . . . . . . . . . . . . . . . . . . . 2418
90.161pylab_examples example code: psd_demo_complex.py . . . . . . . . . . . . . . . . . . . . 2419
90.162pylab_examples example code: pythonic_matplotlib.py . . . . . . . . . . . . . . . . . . . . 2421
90.163pylab_examples example code: quadmesh_demo.py . . . . . . . . . . . . . . . . . . . . . 2423
90.164pylab_examples example code: quiver_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2425
90.165pylab_examples example code: scatter_custom_symbol.py . . . . . . . . . . . . . . . . . . 2432
90.166pylab_examples example code: scatter_demo2.py . . . . . . . . . . . . . . . . . . . . . . . 2433
90.167pylab_examples example code: scatter_hist.py . . . . . . . . . . . . . . . . . . . . . . . . 2435
90.168pylab_examples example code: scatter_masked.py . . . . . . . . . . . . . . . . . . . . . . 2437
90.169pylab_examples example code: scatter_profile.py . . . . . . . . . . . . . . . . . . . . . . . 2438
90.170pylab_examples example code: scatter_star_poly.py . . . . . . . . . . . . . . . . . . . . . 2439
90.171pylab_examples example code: scatter_symbol.py . . . . . . . . . . . . . . . . . . . . . . 2440
90.172pylab_examples example code: set_and_get.py . . . . . . . . . . . . . . . . . . . . . . . . 2441
90.173pylab_examples example code: shading_example.py . . . . . . . . . . . . . . . . . . . . . 2444
90.174pylab_examples example code: shared_axis_across_figures.py . . . . . . . . . . . . . . . . 2447
90.175pylab_examples example code: shared_axis_demo.py . . . . . . . . . . . . . . . . . . . . 2449
90.176pylab_examples example code: simple_plot.py . . . . . . . . . . . . . . . . . . . . . . . . 2451
90.177pylab_examples example code: simple_plot_fps.py . . . . . . . . . . . . . . . . . . . . . . 2452
90.178pylab_examples example code: specgram_demo.py . . . . . . . . . . . . . . . . . . . . . . 2453
90.179pylab_examples example code: spectrum_demo.py . . . . . . . . . . . . . . . . . . . . . . 2455
90.180pylab_examples example code: spine_placement_demo.py . . . . . . . . . . . . . . . . . . 2456
90.181pylab_examples example code: spy_demos.py . . . . . . . . . . . . . . . . . . . . . . . . 2460
90.182pylab_examples example code: stackplot_demo.py . . . . . . . . . . . . . . . . . . . . . . 2461
90.183pylab_examples example code: stackplot_demo2.py . . . . . . . . . . . . . . . . . . . . . 2463
90.184pylab_examples example code: stem_plot.py . . . . . . . . . . . . . . . . . . . . . . . . . 2464
90.185pylab_examples example code: step_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2465
90.186pylab_examples example code: stix_fonts_demo.py . . . . . . . . . . . . . . . . . . . . . 2468
90.187pylab_examples example code: stock_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2470
90.188pylab_examples example code: subplot_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2471
90.189pylab_examples example code: subplot_toolbar.py . . . . . . . . . . . . . . . . . . . . . . 2472
90.190pylab_examples example code: subplots_adjust.py . . . . . . . . . . . . . . . . . . . . . . 2474
90.191pylab_examples example code: subplots_demo.py . . . . . . . . . . . . . . . . . . . . . . 2475
90.192pylab_examples example code: symlog_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2483
90.193pylab_examples example code: system_monitor.py . . . . . . . . . . . . . . . . . . . . . . 2484
90.194pylab_examples example code: table_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2486
90.195pylab_examples example code: tex_demo.py . . . . . . . . . . . . . . . . . . . . . . . . . 2488
90.196pylab_examples example code: tex_unicode_demo.py . . . . . . . . . . . . . . . . . . . . 2489
90.197pylab_examples example code: text_handles.py . . . . . . . . . . . . . . . . . . . . . . . . 2490
90.198pylab_examples example code: text_rotation.py . . . . . . . . . . . . . . . . . . . . . . . 2492
90.199pylab_examples example code: text_rotation_relative_to_line.py . . . . . . . . . . . . . . . 2494
90.200pylab_examples example code: titles_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2495
90.201pylab_examples example code: toggle_images.py . . . . . . . . . . . . . . . . . . . . . . . 2496
90.202pylab_examples example code: transoffset.py . . . . . . . . . . . . . . . . . . . . . . . . . 2499
90.203pylab_examples example code: tricontour_demo.py . . . . . . . . . . . . . . . . . . . . . 2501
90.204pylab_examples example code: tricontour_smooth_delaunay.py . . . . . . . . . . . . . . . 2505
90.205pylab_examples example code: tricontour_smooth_user.py . . . . . . . . . . . . . . . . . . 2508
90.206pylab_examples example code: tricontour_vs_griddata.py . . . . . . . . . . . . . . . . . . 2510
xvii
90.207pylab_examples example code: trigradient_demo.py . . . . . . . . . . . . . . . . . . . . . 2512
90.208pylab_examples example code: triinterp_demo.py . . . . . . . . . . . . . . . . . . . . . . 2514
90.209pylab_examples example code: tripcolor_demo.py . . . . . . . . . . . . . . . . . . . . . . 2516
90.210pylab_examples example code: triplot_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2521
90.211pylab_examples example code: usetex_baseline_test.py . . . . . . . . . . . . . . . . . . . 2525
90.212pylab_examples example code: usetex_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2527
90.213pylab_examples example code: usetex_fonteffects.py . . . . . . . . . . . . . . . . . . . . . 2529
90.214pylab_examples example code: vline_hline_demo.py . . . . . . . . . . . . . . . . . . . . . 2530
90.215pylab_examples example code: webapp_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2531
90.216pylab_examples example code: xcorr_demo.py . . . . . . . . . . . . . . . . . . . . . . . . 2533
90.217pylab_examples example code: zorder_demo.py . . . . . . . . . . . . . . . . . . . . . . . 2534
xviii
96.4 style_sheets example code: plot_ggplot.py . . . . . . . . . . . . . . . . . . . . . . . . . . 2590
96.5 style_sheets example code: plot_grayscale.py . . . . . . . . . . . . . . . . . . . . . . . . . 2592
xix
102.14user_interfaces example code: embedding_in_wx5.py . . . . . . . . . . . . . . . . . . . . 2670
102.15user_interfaces example code: embedding_webagg.py . . . . . . . . . . . . . . . . . . . . 2672
102.16user_interfaces example code: fourier_demo_wx.py . . . . . . . . . . . . . . . . . . . . . 2676
102.17user_interfaces example code: gtk_spreadsheet.py . . . . . . . . . . . . . . . . . . . . . . 2681
102.18user_interfaces example code: histogram_demo_canvasagg.py . . . . . . . . . . . . . . . . 2683
102.19user_interfaces example code: interactive.py . . . . . . . . . . . . . . . . . . . . . . . . . 2684
102.20user_interfaces example code: interactive2.py . . . . . . . . . . . . . . . . . . . . . . . . . 2689
102.21user_interfaces example code: lineprops_dialog_gtk.py . . . . . . . . . . . . . . . . . . . . 2697
102.22user_interfaces example code: mathtext_wx.py . . . . . . . . . . . . . . . . . . . . . . . . 2697
102.23user_interfaces example code: mpl_with_glade.py . . . . . . . . . . . . . . . . . . . . . . 2700
102.24user_interfaces example code: mpl_with_glade_316.py . . . . . . . . . . . . . . . . . . . . 2702
102.25user_interfaces example code: pylab_with_gtk.py . . . . . . . . . . . . . . . . . . . . . . 2703
102.26user_interfaces example code: rec_edit_gtk_custom.py . . . . . . . . . . . . . . . . . . . . 2704
102.27user_interfaces example code: rec_edit_gtk_simple.py . . . . . . . . . . . . . . . . . . . . 2705
102.28user_interfaces example code: svg_histogram.py . . . . . . . . . . . . . . . . . . . . . . . 2705
102.29user_interfaces example code: svg_tooltip.py . . . . . . . . . . . . . . . . . . . . . . . . . 2708
102.30user_interfaces example code: toolmanager.py . . . . . . . . . . . . . . . . . . . . . . . . 2711
102.31user_interfaces example code: wxcursor_demo.py . . . . . . . . . . . . . . . . . . . . . . 2713
XI Glossary 2729
Bibliography 2733
Index 2737
xx
Part I
1
CHAPTER
ONE
COLORMAP
matplotlib is changing the default colormap and styles in the upcoming 2.0 release!
The new default color map will be ‘viridis’ (aka option D). For an introduction to color theory and how
‘viridis’ was generated watch Nathaniel Smith and Stéfan van der Walt’s talk from SciPy2015
All four color maps will be included in matplotlib 1.5.
3
Matplotlib, Release 1.5.1
4 Chapter 1. Colormap
CHAPTER
TWO
EVERYTHING ELSE
We have collected proposals to change any and all visual defaults (including adding new rcParams as
needed).
Michael Droettboom and Thomas Caswell will decide on the new default styles to appear in the upcoming
2.0 release.
A ‘classic’ style sheet will be provided so reverting to the 1.x default values will be a single line of python
(mpl.style.use(’classic’)).
5
Matplotlib, Release 1.5.1
User’s Guide
7
CHAPTER
THREE
INTRODUCTION
matplotlib is a library for making 2D plots of arrays in Python. Although it has its origins in emulating the
MATLAB® 1 graphics commands, it is independent of MATLAB, and can be used in a Pythonic, object
oriented way. Although matplotlib is written primarily in pure Python, it makes heavy use of NumPy and
other extension code to provide good performance even for large arrays.
matplotlib is designed with the philosophy that you should be able to create simple plots with just a few
commands, or just one! If you want to see a histogram of your data, you shouldn’t need to instantiate
objects, call methods, set properties, and so on; it should just work.
For years, I used to use MATLAB exclusively for data analysis and visualization. MATLAB excels at mak-
ing nice looking plots easy. When I began working with EEG data, I found that I needed to write applications
to interact with my data, and developed an EEG analysis application in MATLAB. As the application grew
in complexity, interacting with databases, http servers, manipulating complex data structures, I began to
strain against the limitations of MATLAB as a programming language, and decided to start over in Python.
Python more than makes up for all of MATLAB’s deficiencies as a programming language, but I was having
difficulty finding a 2D plotting package (for 3D VTK more than exceeds all of my needs).
When I went searching for a Python plotting package, I had several requirements:
• Plots should look great - publication quality. One important requirement for me is that the text looks
good (antialiased, etc.)
• Postscript output for inclusion with TeX documents
• Embeddable in a graphical user interface for application development
• Code should be easy enough that I can understand it and extend it
• Making plots should be easy
Finding no package that suited me just right, I did what any self-respecting Python programmer would do:
rolled up my sleeves and dived in. Not having any real experience with computer graphics, I decided to
emulate MATLAB’s plotting capabilities because that is something MATLAB does very well. This had the
added advantage that many people have a lot of MATLAB experience, and thus they can quickly get up to
steam plotting in python. From a developer’s perspective, having a fixed user interface (the pylab interface)
has been very useful, because the guts of the code base can be redesigned without affecting user code.
The matplotlib code is conceptually divided into three parts: the pylab interface is the set of functions
provided by matplotlib.pylab which allow the user to create plots with code quite similar to MATLAB
1
MATLAB is a registered trademark of The MathWorks, Inc.
9
Matplotlib, Release 1.5.1
figure generating code (Pyplot tutorial). The matplotlib frontend or matplotlib API is the set of classes that
do the heavy lifting, creating and managing figures, text, lines, plots and so on (Artist tutorial). This is an
abstract interface that knows nothing about output. The backends are device-dependent drawing devices, aka
renderers, that transform the frontend representation to hardcopy or a display device (What is a backend?).
Example backends: PS creates PostScript® hardcopy, SVG creates Scalable Vector Graphics hardcopy,
Agg creates PNG output using the high quality Anti-Grain Geometry library that ships with matplotlib,
GTK embeds matplotlib in a Gtk+ application, GTKAgg uses the Anti-Grain renderer to create a figure and
embed it in a Gtk+ application, and so on for PDF, WxWidgets, Tkinter, etc.
matplotlib is used by many people in many different contexts. Some people want to automatically generate
PostScript files to send to a printer or publishers. Others deploy matplotlib on a web application server to
generate PNG output for inclusion in dynamically-generated web pages. Some use matplotlib interactively
from the Python shell in Tkinter on Windows™. My primary use is to embed matplotlib in a Gtk+ EEG
application that runs on Windows, Linux and Macintosh OS X.
10 Chapter 3. Introduction
CHAPTER
FOUR
CONFIGURATION GUIDE
4.1 Installing
There are many different ways to install matplotlib, and the best way depends on what operating system you
are using, what you already have installed, and how you want to use it. To avoid wading through all the
details (and potential complications) on this page, there are several convenient options.
The first option is to use one of the pre-packaged python distributions that already provide matplotlib built-in.
The Continuum.io Python distribution (Anaconda or miniconda) and the Enthought distribution (Canopy)
are both excellent choices that “just work” out of the box for Windows, OSX and common Linux platforms.
Both of these distributions include matplotlib and lots of other useful tools. Another excellent alternative
for Windows users is Python (x, y) .
If you are on Linux, you might prefer to use your package manager. matplotlib is packaged for almost every
major Linux distribution.
• Debian / Ubuntu : sudo apt-get install python-matplotlib
• Fedora / Redhat : sudo yum install python-matplotlib
If you are on Mac OSX you can probably install matplotlib binaries using the standard Python installation
program pip. See Installing OSX binary wheels.
11
Matplotlib, Release 1.5.1
Windows
If you don’t already have Python installed, we recommend using one of the scipy-stack compatible Python
distributions such as WinPython, Python(x,y), Enthought Canopy, or Continuum Anaconda, which have
matplotlib and many of its dependencies, plus other useful packages, preinstalled.
For standard Python installations you will also need to install compatible versions of setuptools, numpy,
python-dateutil, pytz, pyparsing, and cycler in addition to matplotlib.
For Python 3.5 the Visual C++ Redistributable for Visual Studio 2015 needs to be installed. In case Python
2.7 to 3.4 are not installed for all users (not the default), the Microsoft Visual C++ 2008 ( 64 bit or 32 bit for
Python 2.7 to 3.2) or Microsoft Visual C++ 2010 ( 64 bit or 32 bit for Python 3.3 and 3.4) redistributable
packages need to be installed.
Matplotlib depends on Pillow for reading and saving JPEG, BMP, and TIFF image files. Matplotlib requires
MiKTeX and GhostScript for rendering text with LaTeX. FFmpeg, avconv, mencoder, or ImageMagick are
required for the animation module.
The following backends should work out of the box: agg, tkagg, ps, pdf and svg. For other backends you
may need to install pycairo, PyQt4, PyQt5, PySide, wxPython, PyGTK, Tornado, or GhostScript.
TkAgg is probably the best backend for interactive use from the standard Python shell or IPython. It is
enabled as the default backend for the official binaries. GTK3 is not supported on Windows.
The Windows installers (*.exe) and wheels (*.whl) on the PyPI download page do not contain test
data or example code. If you want to try the many demos that come in the matplotlib source dis-
tribution, download the *.tar.gz file and look in the examples subdirectory. To run the test suite,
copy the libmatplotlibtests and libmpl_toolkitstests directories from the source distribution to
sys.prefixLibsite-packagesmatplotlib and sys.prefixLibsite-packagesmpl_toolkits re-
spectively, and install nose, mock, Pillow, MiKTeX, GhostScript, ffmpeg, avconv, mencoder, ImageMagick,
and Inkscape.
If you are interested in contributing to matplotlib development, running the latest source code, or just like to
build everything yourself, it is not difficult to build matplotlib from source. Grab the latest tar.gz release file
from the PyPI files page, or if you want to develop matplotlib or just need the latest bugfixed version, grab
the latest git version Source install from git.
The standard environment variables CC, CXX, PKG_CONFIG are respected. This means you can set them if
your toolchain is prefixed. This may be used for cross compiling.
export CC=x86_64-pc-linux-gnu-gcc export CXX=x86_64-pc-linux-gnu-g++ export
PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config
Once you have satisfied the requirements detailed below (mainly python, numpy, libpng and freetype), you
can build matplotlib:
cd matplotlib
python setup.py build
python setup.py install
We provide a setup.cfg file that goes with setup.py which you can use to customize the build process. For
example, which default backend to use, whether some of the optional libraries that matplotlib ships with are
installed, and so on. This file will be particularly useful to those packaging matplotlib.
If you have installed prerequisites to nonstandard places and need to inform matplotlib where they are,
edit setupext.py and add the base dirs to the basedir dictionary entry for your sys.platform. e.g., if
the header to some required library is in /some/path/include/someheader.h, put /some/path in the
basedir list for your platform.
Build requirements
These are external packages which you will need to install before installing matplotlib. If you are building on
OSX, see Building on OSX. If you are building on Windows, see Building on Windows. If you are installing
dependencies with a package manager on Linux, you may need to install the development packages (look
for a “-dev” postfix) in addition to the libraries themselves.
Required Dependencies
These are optional packages which you may want to install to use matplotlib with a user interface toolkit.
See What is a backend? for more details on the optional matplotlib backends and the capabilities they
provide.
tk 8.3 or later The TCL/Tk widgets library used by the TkAgg backend
pyqt 4.0 or later The Qt4 widgets library python wrappers for the Qt4Agg backend
pygtk 2.4 or later The python wrappers for the GTK widgets library for use with the GTK or GTKAgg
backend
4.1. Installing 13
Matplotlib, Release 1.5.1
wxpython 2.8 or later The python wrappers for the wx widgets library for use with the WX or WXAgg
backend
ffmpeg/avconv or mencoder Required for the animation module to be save out put to movie formats.
ImageMagick Required for the animation module to be able to save to animated gif.
Optional dependencies
Pillow If Pillow is installed, matplotlib can read and write a larger selection of image file formats.
pkg-config A tool used to find required non-python libraries. This is not strictly required, but can make
installation go more smoothly if the libraries and headers are not in the expected locations.
agg 2.4 The antigrain C++ rendering engine. matplotlib links against the agg template source statically, so
it will not affect anything on your system outside of matplotlib.
qhull 2012.1 A library for computing Delaunay triangulations.
ttconv truetype font utility
six 1.9.0 Python 2/3 compatibility library. Do not use this in third-party code.
Building on Linux
If you are on Fedora/RedHat, you can get all the dependencies required to build matplotlib by first installing
yum-builddep and then running:
su -c "yum-builddep python-matplotlib"
This does not build matplotlib, but it does get the install the build dependencies, which will make building
from source easier.
Building on OSX
The build situation on OSX is complicated by the various places one can get the libpng and freetype re-
quirements (darwinports, fink, /usr/X11R6) and the different architectures (e.g., x86, ppc, universal) and
the different OSX version (e.g., 10.4 and 10.5). We recommend that you build the way we do for the OSX
release: get the source from the tarball or the git repository and follow the instruction in README.osx.
Building on Windows
The Python shipped from http://www.python.org is compiled with Visual Studio 2008 for versions before 3.3
and Visual Studio 2010 for 3.3 and later. Python extensions are recommended to be compiled with the same
compiler. The .NET Framework 4.0 is required for MSBuild (you’ll likely have the requisite Framework
with Visual Studio). In addition to Visual Studio CMake is required for building libpng.
Since there is no canonical Windows package manager the build methods for freetype, zlib, libpng, tcl, & tk
source code are documented as a build script at matplotlib-winbuild.
Style sheets provide a means for more specific and/or temporary configuration modifications, but in a re-
peatable and well-ordered manner. A style sheet is a file with the same syntax as the matplotlibrc file,
and when applied, it will override the matplotlibrc.
For more information and examples, see Customizing plots with style sheets.
You can also dynamically change the default rc settings in a python script or interactively from the python
shell. All of the rc settings are stored in a dictionary-like variable called matplotlib.rcParams, which is
global to the matplotlib package. rcParams can be modified directly, for example:
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 2
mpl.rcParams['lines.color'] = 'r'
Matplotlib also provides a couple of convenience functions for modifying rc settings. The
matplotlib.rc() command can be used to modify multiple settings in a single group at once, using
keyword arguments:
import matplotlib as mpl
mpl.rc('lines', linewidth=2, color='r')
The matplotlib.rcdefaults() command will restore the standard matplotlib default settings.
There is some degree of validation when setting the values of rcParams, see matplotlib.rcsetup for
details.
matplotlib uses matplotlibrc configuration files to customize all kinds of properties, which we call rc
settings or rc parameters. You can control the defaults of almost every property in matplotlib: figure
size and dpi, line width, color and style, axes, axis and grid properties, text and font properties and so on.
matplotlib looks for matplotlibrc in four locations, in the following order:
1. matplotlibrc in the current working directory, usually used for specific customizations that you do
not want to apply elsewhere.
2. $MATPLOTLIBRC/matplotlibrc.
3. It next looks in a user-specific place, depending on your platform:
• On Linux, it looks in .config/matplotlib/matplotlibrc (or
$XDG_CONFIG_HOME/matplotlib/matplotlibrc) if you’ve customized your environ-
ment.
• On other platforms, it looks in .matplotlib/matplotlibrc.
See matplotlib configuration and cache directory locations.
4. INSTALL/matplotlib/mpl-data/matplotlibrc, where INSTALL is some-
thing like /usr/lib/python2.5/site-packages on Linux, and maybe
C:\Python25\Lib\site-packages on Windows. Every time you install matplotlib, this file
will be overwritten, so if you want your customizations to be saved, please move this file to your
user-specific matplotlib directory.
To display where the currently active matplotlibrc file was loaded from, one can do the following:
>>> import matplotlib
>>> matplotlib.matplotlib_fname()
'/home/foo/.config/matplotlib/matplotlibrc'
# more details on the paths which are checked for the configuration file.
#
# This file is best viewed in a editor which supports python mode
# syntax highlighting. Blank lines, or lines starting with a comment
# symbol, are ignored, as are trailing comments. Other lines must
# have the format
# key : val # optional comment
#
# Colors: for the color values below, you can either use - a
# matplotlib color string, such as r, k, or b - an rgb tuple, such as
# (1.0, 0.5, 0.0) - a hex string, such as ff00ff or #ff00ff - a scalar
# grayscale intensity such as 0.75 - a legal html color name, e.g., red,
# blue, darkslategray
# If you are using the Qt4Agg backend, you can choose here
# to use the PyQt4 bindings or the newer PySide bindings to
# the underlying Qt4 toolkit.
#backend.qt4 : PyQt4 # PyQt4 | PySide
# The port to use for the web server in the WebAgg backend.
# webagg.port : 8888
# When True, the figures rendered in the nbagg backend are created with
# a transparent background.
# nbagg.transparent : True
# if you are running pyplot inside a GUI and your backend choice
# conflicts, we will automatically try to find a compatible one for
# you if backend_fallback is True
#backend_fallback: True
#interactive : False
#toolbar : toolbar2 # None | toolbar2 ("classic" is deprecated)
#timezone : UTC # a pytz timezone string, e.g., US/Central or Europe/Paris
### LINES
# See http://matplotlib.org/api/artist_api.html#module-matplotlib.lines for more
# information on line properties.
#lines.linewidth : 1.0 # line width in points
#lines.linestyle : - # solid line
#lines.color : blue # has no affect on plot(); see axes.prop_cycle
#lines.marker : None # the default marker
#lines.markeredgewidth : 0.5 # the line width around the marker symbol
#lines.markersize : 6 # markersize, in points
#lines.dash_joinstyle : miter # miter|round|bevel
#lines.dash_capstyle : butt # butt|round|projecting
#lines.solid_joinstyle : miter # miter|round|bevel
#lines.solid_capstyle : projecting # butt|round|projecting
#lines.antialiased : True # render lines in antialiased (no jaggies)
### PATCHES
# Patches are graphical objects that fill 2D space, like polygons or
# circles. See
# http://matplotlib.org/api/artist_api.html#module-matplotlib.patches
# information on patch properties
#patch.linewidth : 1.0 # edge width in points
#patch.facecolor : blue
#patch.edgecolor : black
#patch.antialiased : True # render patches in antialiased (no jaggies)
### FONT
#
# font properties used by text.Text. See
# http://matplotlib.org/api/font_manager_api.html for more
# information on font properties. The 6 font properties used for font
# matching are given below with their default values.
#
# The font.family property has five values: 'serif' (e.g., Times),
# 'sans-serif' (e.g., Helvetica), 'cursive' (e.g., Zapf-Chancery),
# 'fantasy' (e.g., Western), and 'monospace' (e.g., Courier). Each of
# these font families has a default list of font names in decreasing
# order of priority associated with them. When text.usetex is False,
# font.family may also be one or more concrete font names.
#
# The font.style property has three values: normal (or roman), italic
# or oblique. The oblique style will be used for italic, if it is not
# present.
#
# The font.variant property has two values: normal or small-caps. For
# TrueType fonts, which are scalable fonts, small-caps is equivalent
# to using a font size of 'smaller', or about 83% of the current font
# size.
#
# The font.weight property has effectively 13 values: normal, bold,
# bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
# 400, and bold is 700. bolder and lighter are relative values with
# respect to the current weight.
#
# The font.stretch property has 11 values: ultra-condensed,
# extra-condensed, condensed, semi-condensed, normal, semi-expanded,
# expanded, extra-expanded, ultra-expanded, wider, and narrower. This
# property is not currently implemented.
#
# The font.size property is the default font size for text, given in pts.
# 12pt is the standard value.
#
#font.family : sans-serif
#font.style : normal
#font.variant : normal
#font.weight : medium
#font.stretch : normal
# note that font.size controls default text sizes. To configure
# special text sizes tick labels, axes, labels, title, etc, see the rc
# settings for axes and ticks. Special text sizes can be defined
# relative to font.size, using the following values: xx-small, x-small,
# small, medium, large, x-large, xx-large, larger, or smaller
#font.size : 12.0
#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC B
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Ava
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, Humor Sans, fantasy
#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed
### TEXT
# text properties used by text.Text. See
# http://matplotlib.org/api/artist_api.html#module-matplotlib.text for more
# information on text properties
#text.color : black
#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling
# unicode strings.
#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
# preamble is a comma separated list of LaTeX statements
# that are included in the LaTeX document preamble.
# An example:
# text.latex.preamble : \usepackage{bm},\usepackage{euler}
# The following packages are always loaded with usetex, so
# beware of package collisions: color, geometry, graphicx,
# type1cm, textcomp. Adobe Postscript (PSSNFS) font packages
# may also be loaded, depending on your font settings
# The following settings allow you to select the fonts in math mode.
# They map from a TeX font name to a fontconfig font pattern.
# These settings are only used if mathtext.fontset is 'custom'.
# Note that this "custom" mode is unsupported and may go away in the
# future.
#mathtext.cal : cursive
#mathtext.rm : serif
#mathtext.tt : monospace
#mathtext.it : serif:italic
#mathtext.bf : serif:bold
#mathtext.sf : sans
#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
# 'stixsans' or 'custom'
#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern
# fonts when a symbol can not be found in one of
### AXES
# default face and edge color, default tick sizes,
# default fontsizes for ticklabels, and so on. See
# http://matplotlib.org/api/axes_api.html#module-matplotlib.axes
#axes.hold : True # whether to clear the axes by default on
#axes.facecolor : white # axes background color
#axes.edgecolor : black # axes edge color
#axes.linewidth : 1.0 # edge linewidth
#axes.grid : False # display grid or not
#axes.titlesize : large # fontsize of the axes title
#axes.labelsize : medium # fontsize of the x any y labels
#axes.labelpad : 5.0 # space between label and axis
#axes.labelweight : normal # weight of the x and y labels
#axes.labelcolor : black
#axes.axisbelow : False # whether axis gridlines and ticks are below
# the axes elements (lines, text, etc)
### TICKS
# see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
#xtick.major.size : 4 # major tick size in points
#xtick.minor.size : 2 # minor tick size in points
#xtick.major.width : 0.5 # major tick width in points
#xtick.minor.width : 0.5 # minor tick width in points
#xtick.major.pad : 4 # distance to major tick label in points
#xtick.minor.pad : 4 # distance to the minor tick label in points
#xtick.color : k # color of the tick labels
#xtick.labelsize : medium # fontsize of the tick labels
#xtick.direction : in # direction: in, out, or inout
### GRIDS
#grid.color : black # grid color
#grid.linestyle : : # dotted
#grid.linewidth : 0.5 # in points
#grid.alpha : 1.0 # transparency, between 0.0 and 1.0
### Legend
#legend.fancybox : False # if True, use a rounded box for the
# legend, else a rectangle
#legend.isaxes : True
#legend.numpoints : 2 # the number of points in the legend line
#legend.fontsize : large
#legend.borderpad : 0.5 # border whitespace in fontsize units
#legend.markerscale : 1.0 # the relative size of legend markers vs. original
# the following dimensions are in axes coords
#legend.labelspacing : 0.5 # the vertical space between the legend entries in fraction of fontsize
#legend.handlelength : 2. # the length of the legend lines in fraction of fontsize
#legend.handleheight : 0.7 # the height of the legend handle in fraction of fontsize
#legend.handletextpad : 0.8 # the space between the legend line and legend text in fraction of fontsi
#legend.borderaxespad : 0.5 # the border between the axes and legend edge in fraction of fontsize
#legend.columnspacing : 2. # the border between the axes and legend edge in fraction of fontsize
#legend.shadow : False
#legend.frameon : True # whether or not to draw a frame around legend
#legend.framealpha : None # opacity of of legend frame
#legend.scatterpoints : 3 # number of scatter points
### FIGURE
# See http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure
#figure.titlesize : medium # size of the figure title
#figure.titleweight : normal # weight of the figure title
### IMAGES
#image.aspect : equal # equal | auto | a number
#image.interpolation : bilinear # see help(imshow) for options
#image.cmap : jet # gray | jet etc...
#image.lut : 256 # the size of the colormap lookup table
#image.origin : upper # lower | upper
#image.resample : False
#image.composite_image : True # When True, all the images on a set of axes are
# combined into a single composite image before
# saving a figure as a vector graphics file,
# such as a PDF.
# the default savefig params can be different from the display params
# e.g., you may want a higher resolution, or to make the figure
# background white
#savefig.dpi : 100 # figure dots per inch
#savefig.facecolor : white # figure facecolor when saving
#savefig.edgecolor : white # figure edgecolor when saving
#savefig.format : png # png, ps, pdf, svg
#savefig.bbox : standard # 'tight' or 'standard'.
# 'tight' is incompatible with pipe-based animation
# backends but will workd with temporary file based ones:
# e.g. setting animation.writer to ffmpeg will not work,
# use ffmpeg_file instead
#savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight'
#savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter.
#savefig.directory : ~ # default directory in savefig dialog box,
# leave empty to always use current working directory
#savefig.transparent : False # setting that controls whether figures are saved with a
# transparent background by default
# tk backend params
#tk.window_focus : False # Maintain shell focus for TkAgg
# ps backend params
#ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
#ps.useafm : False # use of afm fonts, results in small files
#ps.usedistiller : False # can be: None, ghostscript or xpdf
# Experimental: may produce smaller files.
# xpdf intended for production of publication quality files,
# but requires ghostscript, xpdf and ps2eps
#ps.distiller.res : 6000 # dpi
#ps.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType)
# docstring params
#docstring.hardcopy = False # set this when you want to generate hardcopy docstring
#keymap.fullscreen : f # toggling
#keymap.home : h, r, home # home or reset mnemonic
#keymap.back : left, c, backspace # forward / backward keys to enable
#keymap.forward : right, v # left handed quick navigation
#keymap.pan : p # pan mnemonic
#keymap.zoom : o # zoom mnemonic
#keymap.save : s # saving current figure
#keymap.quit : ctrl+w, cmd+w # close the current figure
#keymap.grid : g # switching on/off a grid in current axes
#keymap.yscale : l # toggle scaling of y-axes ('log'/'linear')
#keymap.xscale : L, k # toggle scaling of x-axes ('log'/'linear')
#keymap.all_axes : a # enable all axes
###ANIMATION settings
#animation.html : 'none' # How to display the animation as HTML in
# the IPython notebook. 'html5' uses
# HTML5 video tag.
By default, matplotlib defers drawing until the end of the script because drawing can be an expensive oper-
ation, and you may not want to update the plot every time a single property is changed, only once after all
the properties have changed.
But when working from the python shell, you usually do want to update the plot with every command, e.g.,
after changing the xlabel(), or the marker style of a line. While this is simple in concept, in practice it
can be tricky, because matplotlib is a graphical user interface application under the hood, and there are some
tricks to make the applications work right in a python shell.
Note: The mode described here still exists for historical reasons, but it is highly advised not to use. It
pollutes namespaces with functions that will shadow python built-in and can lead to hard to track bugs.
To get IPython integration without imports the use of the %matplotlib magic is preferred. See ipython
documentation .
Fortunately, ipython, an enhanced interactive python shell, has figured out all of these tricks, and is mat-
plotlib aware, so when you start ipython in the pylab mode.
johnh@flag:~> ipython
Python 2.4.5 (#4, Apr 12 2008, 09:09:16)
IPython 0.9.0 -- An enhanced Interactive Python.
In [1]: %pylab
In [2]: x = randn(10000)
it sets everything up for you so interactive plotting works as you would expect it to. Call figure() and a
figure window pops up, call plot() and your data appears in the figure window.
Note in the example above that we did not import any matplotlib names because in pylab mode, ipython will
import them automatically. ipython also turns on interactive mode for you, which causes every pyplot com-
mand to trigger a figure update, and also provides a matplotlib aware run command to run matplotlib scripts
efficiently. ipython will turn off interactive mode during a run command, and then restore the interactive
state at the end of the run so you can continue tweaking the figure manually.
There has been a lot of recent work to embed ipython, with pylab support, into various GUI applications, so
check on the ipython mailing list for the latest status.
If you can’t use ipython, and still want to use matplotlib/pylab from an interactive python shell, e.g., the
plain-ole standard python interactive interpreter, you are going to need to understand what a matplotlib
backend is What is a backend?.
With the TkAgg backend, which uses the Tkinter user interface toolkit, you can use matplotlib from an
arbitrary non-gui python shell. Just set your backend : TkAgg and interactive : True in your
matplotlibrc file (see Customizing matplotlib) and fire up python. Then:
>>> from pylab import *
>>> plot([1,2,3])
>>> xlabel('hi mom')
should work out of the box. This is also likely to work with recent versions of the qt4agg and gtkagg
backends, and with the macosx backend on the Macintosh. Note, in batch mode, i.e. when making figures
from scripts, interactive mode can be slow since it redraws the figure with each command. So you may want
to think carefully before making this the default behavior via the matplotlibrc file instead of using the
functions listed in the next section.
Gui shells are at best problematic, because they have to run a mainloop, but interactive plotting also involves
a mainloop. Ipython has sorted all this out for the primary matplotlib backends. There may be other shells
and IDEs that also work with matplotlib in interactive mode, but one obvious candidate does not: the python
IDLE IDE is a Tkinter gui app that does not support pylab interactive mode, regardless of backend.
The interactive property of the pyplot interface controls whether a figure canvas is drawn on every pyplot
command. If interactive is False, then the figure state is updated on every plot command, but will only be
drawn on explicit calls to draw(). When interactive is True, then every pyplot command triggers a draw.
The pyplot interface provides 4 commands that are useful for interactive control.
isinteractive() returns the interactive setting True|False
Author: Various
Language: English
LETTER LIAS
LETTERKENNY LIBANIUS
LETTER OF CREDIT LIBATION
LETTERS PATENT LIBAU
LETTRES DE CACHET LIBEL and SLANDER
LETTUCE LIBELLATICI
LEUCADIA LIBER and LIBERA
LEUCIPPUS LIBERAL PARTY
LEUCITE LIBER DIURNUS ROMANORUM
PONTIFICUM
LEUCTRA LIBERIA
LEUK LIBERIUS
LEUTHEN LIBER PONTIFICALIS
LEUTZE, EMANUEL LIBERTAD
LEVALLOIS-PERRET LIBERTARIANISM
LEVANT LIBERTINES
LEVASSEUR, PIERRE EMILE LIBERTINES, SYNAGOGUE OF THE
LEVECHE LIBERTY
LEVÉE (river embankment) LIBERTY PARTY
LEVEE (reception) LIBITINA
LEVELLERS LIBMANAN
LEVEN, ALEXANDER LESLIE LIBO
LEVEN (Scotish burgh) LIBON
LEVEN, LOCH LIBOURNE
LEVEN AND MELVILLE, EARLS LIBRA
OF
LEVER, CHARLES JAMES LIBRARIES
LEVER LIBRATION
LEVERRIER, URBAIN JEAN LIBYA
JOSEPH
LEVERTIN, OSCAR IVAN LICATA
LEVI, HERMANN LICENCE
LEVI, LEONE LICHEN
LEVIATHAN LICHENS
LEVIRATE LICHFIELD
LÉVIS LICH-GATE
LEVITES LICHTENBERG, GEORG CHRISTOPH
LEVITICUS LICHTENBERG (German principality)
LEVY, AMY LICINIANUS, GRANIUS
LEVY, AUGUSTE MICHEL LICINIUS
LEVY (money raising) LICINIUS CALVUS STOLO, GAIUS
LEWALD, FANNY LICINIUS MACER CALVUS, GAIUS
LEWANIKA LICODIA EUBEA
LEWES, CHARLES LEE LICTORS
LEWES, GEORGE HENRY LIDDELL, HENRY GEORGE
LEWES (town of England) LIDDESDALE
LEWES (Delaware, U.S.A.) LIDDON, HENRY PARRY
LEWIS, SIR GEORGE LIE, JONAS LAURITZ EDEMIL
CORNEWALL
LEWIS, HENRY CARVILL LIE, MARIUS SOPHUS
LEWIS, JOHN FREDERICK LIEBER, FRANCIS
LEWIS, MATTHEW GREGORY LIEBERMANN, MAX
LEWIS, MERIWETHER LIEBIG, JUSTUS VON
LEWISBURG LIEBKNECHT, WILHELM
LEWISHAM LIECHTENSTEIN
LEWISTON LIÉGE (province of Belgium)
LEWIS-WITH-HARRIS LIÉGE (Belgian city)
LEXICON LIEGE (feudal term)
LEXINGTON, BARON LIEGNITZ
LEXINGTON (Kentucky, LIEN
U.S.A.)
LEXINGTON (Massachusetts, LIERRE
U.S.A.)
LEXINGTON (Missouri, U.S.A.) LIESTAL
LEXINGTON (Virginia, U.S.A.) LIEUTENANT
LEYDEN, JOHN LIFE
LEYDEN JAR LIFE-BOAT, and LIFE-SAVING
SERVICE
LEYS, HENDRIK LIFFORD
LEYTON LIGAMENT
LHASA LIGAO
L’HÔPITAL, MICHEL DE LIGHT
LIAO-YANG LIGHTFOOT, JOHN
There are two races of the lettuce, the Cos lettuce, with erect
oblong heads, and the Cabbage lettuce, with round or spreading
heads,—the former generally crisp, the latter soft and flabby in
texture. Some of the best lettuces for general purposes of the two
classes are the following:—
Cos: White Paris Cos, best for summer; Green Paris Cos, hardier
than the white; Brown Cos, Lobjoits Green Cos, one of the hardiest
and best for winter; Hardy White Cos.
Leucite lavas from which felspar is absent are divided into the
leucitites and leucite basalts. The latter contain olivine, the
former do not. Pyroxene is the usual ferromagnesian mineral,
and resembles that of the tephrites and basanites. Sanidine,
melanite, hauyne and perofskite are frequent accessory minerals
in these rocks, and many of them contain melilite in some
quantity. The well-known leucitite of the Capo di Bove, near
Rome, is rich in this mineral, which forms irregular plates, yellow
in the hand specimen, enclosing many small rounded crystals of
leucite. Bracciano and Roccamonfina are other Italian localities
for leucitite, and in Java, Montana, Celebes and New South
Wales similar rocks occur. The leucite-basalts belong to more
basic types and are rich in olivine and augite. They occur in
great numbers in the Rhenish volcanic district (Eifel, Laacher
See) and in Bohemia, and accompany tephrites or leucitites in
Java, Montana, Celebes and Sardinia. The “peperino” of the
neighbourhood of Rome is a leucitite tuff. (J. S. F.)
See Carlyle, Frederick, bk. xviii. cap. x.; V. Ollech, Friedrich der
Grosse von Kolin bis Leuthen (Berlin, 1858); Kutzen, Schlacht bei
Leuthen (Breslau, 1851 ); and bibliography under Seven Years’
War.
ebookbell.com