Skip to content

Commit f02d442

Browse files
committed
updates after Plotting-palooza
1 parent 1259531 commit f02d442

6 files changed

Lines changed: 324 additions & 266 deletions

File tree

lessons/lesson13.ipynb

Lines changed: 111 additions & 108 deletions
Large diffs are not rendered by default.

lessons/lesson14.1.ipynb

Lines changed: 51 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@
104104
"cell_type": "code",
105105
"execution_count": 6,
106106
"metadata": {},
107+
"outputs": [],
108+
"source": [
109+
"import seaborn as sns"
110+
]
111+
},
112+
{
113+
"cell_type": "code",
114+
"execution_count": 7,
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"# switch to seaborn defaults\n",
119+
"sns.set()"
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": 8,
125+
"metadata": {},
107126
"outputs": [
108127
{
109128
"data": {
@@ -117,10 +136,6 @@
117136
}
118137
],
119138
"source": [
120-
"import seaborn as sns\n",
121-
"\n",
122-
"# switch to seaborn defaults\n",
123-
"sns.set()\n",
124139
"sinplot()"
125140
]
126141
},
@@ -132,17 +147,21 @@
132147
"\n",
133148
"Seaborn splits matplotlib parameters into two independent groups. The first group sets the aesthetic style of the plot, and the second scales various elements of the figure so that it can be easily incorporated into different contexts.\n",
134149
"\n",
135-
"The interface for manipulating these parameters are two pairs of functions. To control the style, use the `axes_style` and `set_style` functions. To scale the plot, use the `plotting_context` and `set_context` functions. In both cases, the first function returns a dictionary of parameters and the second sets the matplotlib defaults.\n",
136-
"\n",
137-
"\n",
150+
"The interface for manipulating these parameters are two pairs of functions. To control the style, use the `axes_style` and `set_style` functions. To scale the plot, use the `plotting_context` and `set_context` functions. In both cases, the first function returns a dictionary of parameters and the second sets the matplotlib defaults."
151+
]
152+
},
153+
{
154+
"cell_type": "markdown",
155+
"metadata": {},
156+
"source": [
138157
"### Styling figures with `axes_style` and `set_style`\n",
139158
"\n",
140-
"There are five preset seaborn themes: ``darkgrid``, ``whitegrid``, ``dark``, ``white``, and ``ticks``. They are each suited to different applications and personal preferences. The default theme is ``darkgrid``. As mentioned above, the grid helps the plot serve as a lookup table for quantitative information, and the white-on grey helps to keep the grid from competing with lines that represent data. The ``whitegrid`` theme is similar, but it is better suited to plots with heavy data elements:"
159+
"There are five preset seaborn themes: `darkgrid` (default), `whitegrid`, `dark`, `white`, and `ticks`. They are each suited to different applications and personal preferences. As mentioned above, the grid helps the plot serve as a lookup table for quantitative information, and the white-on grey helps to keep the grid from competing with lines that represent data. The `whitegrid` theme is similar, but it is better suited to plots with heavy data elements:"
141160
]
142161
},
143162
{
144163
"cell_type": "code",
145-
"execution_count": 7,
164+
"execution_count": 9,
146165
"metadata": {},
147166
"outputs": [
148167
{
@@ -157,61 +176,31 @@
157176
" [ 1.13731585, 0.29993136, 1.98293321, 0.43116569, 1.89488735,\n",
158177
" 1.5665543 ],\n",
159178
" [ 0.37892569, 0.32892184, 0.49832548, -0.10304403, 2.06510083,\n",
160-
" 2.69116086],\n",
161-
" [-0.66920923, -0.58088412, 0.59611132, 3.30575676, 3.20531154,\n",
162-
" 2.40979019],\n",
163-
" [ 0.52448246, 0.79002931, 0.33452638, 0.25767919, 1.44914163,\n",
164-
" 1.25721224],\n",
165-
" [-0.10996288, 0.67140701, 0.65084974, 1.79305109, 2.79651242,\n",
166-
" 1.18214425],\n",
167-
" [ 2.35663418, -0.81431246, -0.55036182, 0.78515772, 3.89248445,\n",
168-
" 2.13327079],\n",
169-
" [ 1.67811696, 0.54806375, 1.78530229, 2.05304121, 1.22106051,\n",
170-
" 3.50759657],\n",
171-
" [-0.47731063, -1.33317443, 0.75998427, 1.64008189, 2.2505344 ,\n",
172-
" 2.38809898],\n",
173-
" [-1.66141717, 0.1301824 , -1.6507159 , 2.32107706, 1.81272685,\n",
174-
" 3.13004891],\n",
175-
" [-0.50479809, -0.81580286, 1.63682301, 1.22489375, 4.5090617 ,\n",
176-
" 1.35874188],\n",
177-
" [ 1.35761983, 0.40155948, 1.07699186, -0.32231095, 3.03982627,\n",
178-
" 2.13841975],\n",
179-
" [-1.10324139, -0.37038144, 1.75178333, 1.51099683, 3.5814129 ,\n",
180-
" 2.41845365],\n",
181-
" [-1.73261607, 0.34837884, 0.10872178, 1.32224656, 1.06883336,\n",
182-
" 1.49099132],\n",
183-
" [-0.16522382, 0.86500033, 0.03285366, 1.32297166, 0.57209409,\n",
184-
" 2.96647196],\n",
185-
" [-0.36831025, 2.21999464, 0.20901714, -0.05432129, 1.33930154,\n",
186-
" 2.08025704],\n",
187-
" [-0.42431996, -0.68862989, 0.49011345, 2.83584393, 2.21008733,\n",
188-
" 1.30686016],\n",
189-
" [ 0.14623715, 0.78818687, 0.5975404 , 0.63173979, 1.21414596,\n",
190-
" 3.60836031]])"
179+
" 2.69116086]])"
191180
]
192181
},
193-
"execution_count": 7,
182+
"execution_count": 9,
194183
"metadata": {},
195184
"output_type": "execute_result"
196185
}
197186
],
198187
"source": [
199188
"data = np.random.normal(size=(20, 6)) + np.arange(6) / 2\n",
200-
"data"
189+
"data[:5]"
201190
]
202191
},
203192
{
204193
"cell_type": "code",
205-
"execution_count": 8,
194+
"execution_count": 10,
206195
"metadata": {},
207196
"outputs": [
208197
{
209198
"data": {
210199
"text/plain": [
211-
"<matplotlib.axes._subplots.AxesSubplot at 0x1a296fdd68>"
200+
"<matplotlib.axes._subplots.AxesSubplot at 0x1a24576240>"
212201
]
213202
},
214-
"execution_count": 8,
203+
"execution_count": 10,
215204
"metadata": {},
216205
"output_type": "execute_result"
217206
},
@@ -240,7 +229,7 @@
240229
},
241230
{
242231
"cell_type": "code",
243-
"execution_count": 9,
232+
"execution_count": 11,
244233
"metadata": {},
245234
"outputs": [
246235
{
@@ -261,7 +250,7 @@
261250
},
262251
{
263252
"cell_type": "code",
264-
"execution_count": 10,
253+
"execution_count": 12,
265254
"metadata": {},
266255
"outputs": [
267256
{
@@ -289,7 +278,7 @@
289278
},
290279
{
291280
"cell_type": "code",
292-
"execution_count": 11,
281+
"execution_count": 13,
293282
"metadata": {},
294283
"outputs": [
295284
{
@@ -319,7 +308,7 @@
319308
},
320309
{
321310
"cell_type": "code",
322-
"execution_count": 12,
311+
"execution_count": 14,
323312
"metadata": {},
324313
"outputs": [
325314
{
@@ -347,7 +336,7 @@
347336
},
348337
{
349338
"cell_type": "code",
350-
"execution_count": 13,
339+
"execution_count": 15,
351340
"metadata": {},
352341
"outputs": [
353342
{
@@ -384,7 +373,7 @@
384373
},
385374
{
386375
"cell_type": "code",
387-
"execution_count": 14,
376+
"execution_count": 16,
388377
"metadata": {},
389378
"outputs": [
390379
{
@@ -415,7 +404,7 @@
415404
},
416405
{
417406
"cell_type": "code",
418-
"execution_count": 15,
407+
"execution_count": 17,
419408
"metadata": {},
420409
"outputs": [
421410
{
@@ -450,7 +439,7 @@
450439
},
451440
{
452441
"cell_type": "code",
453-
"execution_count": 16,
442+
"execution_count": 18,
454443
"metadata": {},
455444
"outputs": [
456445
{
@@ -489,7 +478,7 @@
489478
" 'axes.spines.top': True}"
490479
]
491480
},
492-
"execution_count": 16,
481+
"execution_count": 18,
493482
"metadata": {},
494483
"output_type": "execute_result"
495484
}
@@ -507,7 +496,7 @@
507496
},
508497
{
509498
"cell_type": "code",
510-
"execution_count": 17,
499+
"execution_count": 19,
511500
"metadata": {},
512501
"outputs": [
513502
{
@@ -528,7 +517,7 @@
528517
},
529518
{
530519
"cell_type": "code",
531-
"execution_count": 18,
520+
"execution_count": 20,
532521
"metadata": {},
533522
"outputs": [
534523
{
@@ -567,7 +556,7 @@
567556
" 'axes.spines.top': True}"
568557
]
569558
},
570-
"execution_count": 18,
559+
"execution_count": 20,
571560
"metadata": {},
572561
"output_type": "execute_result"
573562
}
@@ -589,7 +578,7 @@
589578
},
590579
{
591580
"cell_type": "code",
592-
"execution_count": 19,
581+
"execution_count": 21,
593582
"metadata": {},
594583
"outputs": [],
595584
"source": [
@@ -605,7 +594,7 @@
605594
},
606595
{
607596
"cell_type": "code",
608-
"execution_count": 20,
597+
"execution_count": 22,
609598
"metadata": {},
610599
"outputs": [
611600
{
@@ -627,7 +616,7 @@
627616
},
628617
{
629618
"cell_type": "code",
630-
"execution_count": 21,
619+
"execution_count": 23,
631620
"metadata": {},
632621
"outputs": [
633622
{
@@ -649,7 +638,7 @@
649638
},
650639
{
651640
"cell_type": "code",
652-
"execution_count": 22,
641+
"execution_count": 24,
653642
"metadata": {},
654643
"outputs": [
655644
{
@@ -682,7 +671,7 @@
682671
},
683672
{
684673
"cell_type": "code",
685-
"execution_count": 23,
674+
"execution_count": 25,
686675
"metadata": {},
687676
"outputs": [
688677
{

lessons/lesson14.2.ipynb

Lines changed: 106 additions & 47 deletions
Large diffs are not rendered by default.

lessons/lesson14.3.ipynb

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

0 commit comments

Comments
 (0)