|
22 | 22 | "## Overview\n", |
23 | 23 | "We will cover the basics of plotting within Python, using the Matplotlib library, including a few different plots available within the library.\n", |
24 | 24 | "\n", |
| 25 | + "1. Why Matplotlib?\n", |
25 | 26 | "1. Figure and axes\n", |
26 | 27 | "1. Basic line plots\n", |
27 | 28 | "1. Labels and grid lines\n", |
|
54 | 55 | "---" |
55 | 56 | ] |
56 | 57 | }, |
| 58 | + { |
| 59 | + "cell_type": "markdown", |
| 60 | + "metadata": {}, |
| 61 | + "source": [ |
| 62 | + "## Why Matplotlib?\n", |
| 63 | + "\n", |
| 64 | + "Matplotlib is a plotting library for Python and is often the first plotting package Python-learners encounter. You may be wondering, \"Why learn Matplotlib? Why not Seaborn or another plotting library first?\"\n", |
| 65 | + "\n", |
| 66 | + "The simple answer is because of Matplotlib's popularity. Matplotlib is one of the most popular Python packages. Because of its history as Python's \"go-to\" plotting package, most other open source plotting libraries (including Seaborn) are built on top of Matplotlib and thus these improved or specialized plotting packages still inherit some of Matplotlib's capabilities, syntax, and limitations. You will find it useful to be familiar with Matplotlib when learning other plotting libraries.\n", |
| 67 | + "\n", |
| 68 | + "Matplotlib supports a variety of output formats, chart types, and interactive options, and runs well on most operating systems and graphic backends. These features are part of \"Why Matplotlib\" is so popular, and the first plotting language we will introduce you to in this book." |
| 69 | + ] |
| 70 | + }, |
57 | 71 | { |
58 | 72 | "cell_type": "markdown", |
59 | 73 | "metadata": {}, |
|
213 | 227 | "ax.plot(times, temps);" |
214 | 228 | ] |
215 | 229 | }, |
216 | | - { |
| 230 | + { |
217 | 231 | "cell_type": "markdown", |
218 | 232 | "metadata": {}, |
219 | 233 | "source": [ |
|
629 | 643 | "ax2.grid(True)\n", |
630 | 644 | "ax2.legend(loc='upper left')\n", |
631 | 645 | "ax2.set_ylim(257, 312)\n", |
632 | | - "ax2.set_xlim(95, 162)" |
| 646 | + "ax2.set_xlim(95, 162);" |
633 | 647 | ] |
634 | 648 | }, |
635 | 649 | { |
|
839 | 853 | " Z, interpolation='bilinear', cmap='PiYG', origin='lower', extent=[-3, 3, -3, 3]\n", |
840 | 854 | ")\n", |
841 | 855 | "c = ax.contour(X, Y, Z, levels=np.arange(-2, 2, 0.5), colors='black')\n", |
842 | | - "ax.clabel(c)" |
| 856 | + "ax.clabel(c);" |
843 | 857 | ] |
844 | 858 | }, |
845 | 859 | { |
|
0 commit comments