|
104 | 104 | "cell_type": "code", |
105 | 105 | "execution_count": 6, |
106 | 106 | "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": {}, |
107 | 126 | "outputs": [ |
108 | 127 | { |
109 | 128 | "data": { |
|
117 | 136 | } |
118 | 137 | ], |
119 | 138 | "source": [ |
120 | | - "import seaborn as sns\n", |
121 | | - "\n", |
122 | | - "# switch to seaborn defaults\n", |
123 | | - "sns.set()\n", |
124 | 139 | "sinplot()" |
125 | 140 | ] |
126 | 141 | }, |
|
132 | 147 | "\n", |
133 | 148 | "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", |
134 | 149 | "\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": [ |
138 | 157 | "### Styling figures with `axes_style` and `set_style`\n", |
139 | 158 | "\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:" |
141 | 160 | ] |
142 | 161 | }, |
143 | 162 | { |
144 | 163 | "cell_type": "code", |
145 | | - "execution_count": 7, |
| 164 | + "execution_count": 9, |
146 | 165 | "metadata": {}, |
147 | 166 | "outputs": [ |
148 | 167 | { |
|
157 | 176 | " [ 1.13731585, 0.29993136, 1.98293321, 0.43116569, 1.89488735,\n", |
158 | 177 | " 1.5665543 ],\n", |
159 | 178 | " [ 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]])" |
191 | 180 | ] |
192 | 181 | }, |
193 | | - "execution_count": 7, |
| 182 | + "execution_count": 9, |
194 | 183 | "metadata": {}, |
195 | 184 | "output_type": "execute_result" |
196 | 185 | } |
197 | 186 | ], |
198 | 187 | "source": [ |
199 | 188 | "data = np.random.normal(size=(20, 6)) + np.arange(6) / 2\n", |
200 | | - "data" |
| 189 | + "data[:5]" |
201 | 190 | ] |
202 | 191 | }, |
203 | 192 | { |
204 | 193 | "cell_type": "code", |
205 | | - "execution_count": 8, |
| 194 | + "execution_count": 10, |
206 | 195 | "metadata": {}, |
207 | 196 | "outputs": [ |
208 | 197 | { |
209 | 198 | "data": { |
210 | 199 | "text/plain": [ |
211 | | - "<matplotlib.axes._subplots.AxesSubplot at 0x1a296fdd68>" |
| 200 | + "<matplotlib.axes._subplots.AxesSubplot at 0x1a24576240>" |
212 | 201 | ] |
213 | 202 | }, |
214 | | - "execution_count": 8, |
| 203 | + "execution_count": 10, |
215 | 204 | "metadata": {}, |
216 | 205 | "output_type": "execute_result" |
217 | 206 | }, |
|
240 | 229 | }, |
241 | 230 | { |
242 | 231 | "cell_type": "code", |
243 | | - "execution_count": 9, |
| 232 | + "execution_count": 11, |
244 | 233 | "metadata": {}, |
245 | 234 | "outputs": [ |
246 | 235 | { |
|
261 | 250 | }, |
262 | 251 | { |
263 | 252 | "cell_type": "code", |
264 | | - "execution_count": 10, |
| 253 | + "execution_count": 12, |
265 | 254 | "metadata": {}, |
266 | 255 | "outputs": [ |
267 | 256 | { |
|
289 | 278 | }, |
290 | 279 | { |
291 | 280 | "cell_type": "code", |
292 | | - "execution_count": 11, |
| 281 | + "execution_count": 13, |
293 | 282 | "metadata": {}, |
294 | 283 | "outputs": [ |
295 | 284 | { |
|
319 | 308 | }, |
320 | 309 | { |
321 | 310 | "cell_type": "code", |
322 | | - "execution_count": 12, |
| 311 | + "execution_count": 14, |
323 | 312 | "metadata": {}, |
324 | 313 | "outputs": [ |
325 | 314 | { |
|
347 | 336 | }, |
348 | 337 | { |
349 | 338 | "cell_type": "code", |
350 | | - "execution_count": 13, |
| 339 | + "execution_count": 15, |
351 | 340 | "metadata": {}, |
352 | 341 | "outputs": [ |
353 | 342 | { |
|
384 | 373 | }, |
385 | 374 | { |
386 | 375 | "cell_type": "code", |
387 | | - "execution_count": 14, |
| 376 | + "execution_count": 16, |
388 | 377 | "metadata": {}, |
389 | 378 | "outputs": [ |
390 | 379 | { |
|
415 | 404 | }, |
416 | 405 | { |
417 | 406 | "cell_type": "code", |
418 | | - "execution_count": 15, |
| 407 | + "execution_count": 17, |
419 | 408 | "metadata": {}, |
420 | 409 | "outputs": [ |
421 | 410 | { |
|
450 | 439 | }, |
451 | 440 | { |
452 | 441 | "cell_type": "code", |
453 | | - "execution_count": 16, |
| 442 | + "execution_count": 18, |
454 | 443 | "metadata": {}, |
455 | 444 | "outputs": [ |
456 | 445 | { |
|
489 | 478 | " 'axes.spines.top': True}" |
490 | 479 | ] |
491 | 480 | }, |
492 | | - "execution_count": 16, |
| 481 | + "execution_count": 18, |
493 | 482 | "metadata": {}, |
494 | 483 | "output_type": "execute_result" |
495 | 484 | } |
|
507 | 496 | }, |
508 | 497 | { |
509 | 498 | "cell_type": "code", |
510 | | - "execution_count": 17, |
| 499 | + "execution_count": 19, |
511 | 500 | "metadata": {}, |
512 | 501 | "outputs": [ |
513 | 502 | { |
|
528 | 517 | }, |
529 | 518 | { |
530 | 519 | "cell_type": "code", |
531 | | - "execution_count": 18, |
| 520 | + "execution_count": 20, |
532 | 521 | "metadata": {}, |
533 | 522 | "outputs": [ |
534 | 523 | { |
|
567 | 556 | " 'axes.spines.top': True}" |
568 | 557 | ] |
569 | 558 | }, |
570 | | - "execution_count": 18, |
| 559 | + "execution_count": 20, |
571 | 560 | "metadata": {}, |
572 | 561 | "output_type": "execute_result" |
573 | 562 | } |
|
589 | 578 | }, |
590 | 579 | { |
591 | 580 | "cell_type": "code", |
592 | | - "execution_count": 19, |
| 581 | + "execution_count": 21, |
593 | 582 | "metadata": {}, |
594 | 583 | "outputs": [], |
595 | 584 | "source": [ |
|
605 | 594 | }, |
606 | 595 | { |
607 | 596 | "cell_type": "code", |
608 | | - "execution_count": 20, |
| 597 | + "execution_count": 22, |
609 | 598 | "metadata": {}, |
610 | 599 | "outputs": [ |
611 | 600 | { |
|
627 | 616 | }, |
628 | 617 | { |
629 | 618 | "cell_type": "code", |
630 | | - "execution_count": 21, |
| 619 | + "execution_count": 23, |
631 | 620 | "metadata": {}, |
632 | 621 | "outputs": [ |
633 | 622 | { |
|
649 | 638 | }, |
650 | 639 | { |
651 | 640 | "cell_type": "code", |
652 | | - "execution_count": 22, |
| 641 | + "execution_count": 24, |
653 | 642 | "metadata": {}, |
654 | 643 | "outputs": [ |
655 | 644 | { |
|
682 | 671 | }, |
683 | 672 | { |
684 | 673 | "cell_type": "code", |
685 | | - "execution_count": 23, |
| 674 | + "execution_count": 25, |
686 | 675 | "metadata": {}, |
687 | 676 | "outputs": [ |
688 | 677 | { |
|
0 commit comments