Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a193d6e

Browse files
committed
More cleanup
1 parent a4ae350 commit a193d6e

9 files changed

Lines changed: 671 additions & 12059 deletions

00_Getting_started.ipynb

Lines changed: 71 additions & 129 deletions
Large diffs are not rendered by default.

01_Interfaces.ipynb

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"metadata": {},
6-
"source": [
7-
"The usual imports:"
8-
]
9-
},
103
{
114
"cell_type": "code",
125
"execution_count": null,
@@ -202,20 +195,6 @@
202195
"- `pyplot` can be a convenience for simple quick plots. \n",
203196
" But understand how it works and relates to the underlying objects. - Otherwise it will be confusing."
204197
]
205-
},
206-
{
207-
"cell_type": "code",
208-
"execution_count": null,
209-
"metadata": {},
210-
"outputs": [],
211-
"source": []
212-
},
213-
{
214-
"cell_type": "code",
215-
"execution_count": null,
216-
"metadata": {},
217-
"outputs": [],
218-
"source": []
219198
}
220199
],
221200
"metadata": {
@@ -234,7 +213,7 @@
234213
"name": "python",
235214
"nbconvert_exporter": "python",
236215
"pygments_lexer": "ipython3",
237-
"version": "3.10.4"
216+
"version": "3.11.4"
238217
}
239218
},
240219
"nbformat": 4,

02_Figure.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Figure and Subplots\n",
8-
"\n",
9-
"The usual imports:"
7+
"# Figure and Subplots"
108
]
119
},
1210
{
@@ -60,8 +58,7 @@
6058
"source": [
6159
"fig, ax = plt.subplots()\n",
6260
"fig.set_facecolor('blue')\n",
63-
"ax.set_facecolor('seagreen')\n",
64-
"#ax.set_alpha(1)"
61+
"ax.set_facecolor('seagreen')"
6562
]
6663
},
6764
{
@@ -520,7 +517,7 @@
520517
"name": "python",
521518
"nbconvert_exporter": "python",
522519
"pygments_lexer": "ipython3",
523-
"version": "3.10.4"
520+
"version": "3.11.4"
524521
}
525522
},
526523
"nbformat": 4,

03_adding_content.ipynb

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
"cell_type": "markdown",
302302
"metadata": {},
303303
"source": [
304-
"## Categorical bar plots"
304+
"## Bar plots"
305305
]
306306
},
307307
{
@@ -310,20 +310,9 @@
310310
"metadata": {},
311311
"outputs": [],
312312
"source": [
313-
"# recommended: pass labels as x\n",
314-
"labels = ['a', 'b', 'c', 'd']\n",
315-
"plt.bar(labels, x**2)"
316-
]
317-
},
318-
{
319-
"cell_type": "markdown",
320-
"metadata": {},
321-
"source": [
322-
"### Example: Multiple bars\n",
323-
"\n",
324-
"It's a pain, because you have to position and size them manually.\n",
325-
"\n",
326-
"We'll learn better ways later using pandas later."
313+
"x = [0, 1, 2, 3]\n",
314+
"y = [1, 4, 9, 16]\n",
315+
"plt.bar(x, y)"
327316
]
328317
},
329318
{
@@ -332,8 +321,9 @@
332321
"metadata": {},
333322
"outputs": [],
334323
"source": [
335-
"plt.bar(x-0.2, x**2, width=0.4)\n",
336-
"plt.bar(x+0.2, (0.5-x)**2, width=0.4)"
324+
"labels = ['a', 'b', 'c', 'd']\n",
325+
"plt.bar(labels, y)\n",
326+
"#plt.plot(x, y, 'ro')"
337327
]
338328
},
339329
{
@@ -342,12 +332,27 @@
342332
"source": [
343333
"## Other plotting functions\n",
344334
"\n",
335+
"The concept is always the same:\n",
336+
"\n",
337+
"- an Axes method creates the data Artists and adds them to the Axes\n",
338+
"- the first few arguments describe the data\n",
339+
"- there are many optional keworda arguments to customize style and behavior\n",
340+
"\n",
341+
"\n",
345342
"See\n",
346343
"\n",
347344
"- https://matplotlib.org/stable/plot_types/index.html\n",
348-
"- https://matplotlib.org/stable/api/axes_api.html"
345+
"- https://matplotlib.org/stable/api/axes_api.html\n",
346+
"\n"
349347
]
350348
},
349+
{
350+
"cell_type": "code",
351+
"execution_count": null,
352+
"metadata": {},
353+
"outputs": [],
354+
"source": []
355+
},
351356
{
352357
"cell_type": "code",
353358
"execution_count": null,
@@ -372,7 +377,7 @@
372377
"name": "python",
373378
"nbconvert_exporter": "python",
374379
"pygments_lexer": "ipython3",
375-
"version": "3.10.4"
380+
"version": "3.11.4"
376381
}
377382
},
378383
"nbformat": 4,

04_Configuration and Styles.ipynb

Lines changed: 563 additions & 23 deletions
Large diffs are not rendered by default.

05_Libraries_using_Matplotlib.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
"name": "python",
408408
"nbconvert_exporter": "python",
409409
"pygments_lexer": "ipython3",
410-
"version": "3.10.4"
410+
"version": "3.11.4"
411411
}
412412
},
413413
"nbformat": 4,

0 commit comments

Comments
 (0)