Skip to content

Commit 9e42097

Browse files
authored
Add colormap overview blurb (#236)
* add colormap dropdowns * add colormap overview * update section titles * rm subplots (check additional topics 1) * fix dropdown * add plt.subplot descr * missing ; * clear output * add why matplotlib
1 parent edae0c3 commit 9e42097

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

core/matplotlib/additional-topics2.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@
305305
"id": "60564465-4b40-467b-a1a5-d10c4378329c",
306306
"metadata": {},
307307
"source": [
308-
"## Colormap Overview"
308+
"## Colormap Overview\n",
309+
"\n",
310+
"Colormaps are a visually appealing way to represent another dimension to your data. They are a matrix of hues and values allowing you to, for example, display hotter temperatures as red and colder temperatures as blue."
309311
]
310312
},
311313
{
@@ -360,6 +362,12 @@
360362
"</details>"
361363
]
362364
},
365+
{
366+
"cell_type": "markdown",
367+
"id": "e1bff589",
368+
"metadata": {},
369+
"source": []
370+
},
363371
{
364372
"cell_type": "markdown",
365373
"id": "5ce3b4c7-1186-4067-9b34-552382bf614e",

core/matplotlib/matplotlib.ipynb

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"## Overview\n",
2323
"We will cover the basics of plotting within Python, using the Matplotlib library, including a few different plots available within the library.\n",
2424
"\n",
25+
"1. Why Matplotlib?\n",
2526
"1. Figure and axes\n",
2627
"1. Basic line plots\n",
2728
"1. Labels and grid lines\n",
@@ -54,6 +55,19 @@
5455
"---"
5556
]
5657
},
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+
},
5771
{
5872
"cell_type": "markdown",
5973
"metadata": {},
@@ -213,7 +227,7 @@
213227
"ax.plot(times, temps);"
214228
]
215229
},
216-
{
230+
{
217231
"cell_type": "markdown",
218232
"metadata": {},
219233
"source": [
@@ -629,7 +643,7 @@
629643
"ax2.grid(True)\n",
630644
"ax2.legend(loc='upper left')\n",
631645
"ax2.set_ylim(257, 312)\n",
632-
"ax2.set_xlim(95, 162)"
646+
"ax2.set_xlim(95, 162);"
633647
]
634648
},
635649
{
@@ -839,7 +853,7 @@
839853
" Z, interpolation='bilinear', cmap='PiYG', origin='lower', extent=[-3, 3, -3, 3]\n",
840854
")\n",
841855
"c = ax.contour(X, Y, Z, levels=np.arange(-2, 2, 0.5), colors='black')\n",
842-
"ax.clabel(c)"
856+
"ax.clabel(c);"
843857
]
844858
},
845859
{

0 commit comments

Comments
 (0)