|
58 | 58 | "name": "stdout",
|
59 | 59 | "output_type": "stream",
|
60 | 60 | "text": [
|
61 |
| - "Wed Sep 25 2019 \n", |
| 61 | + "watermark 1.8.1\n", |
| 62 | + "matplotlib 3.1.0\n", |
| 63 | + "numpy 1.16.2\n", |
| 64 | + "pandas 0.24.2\n", |
| 65 | + "Sun Dec 01 2019 \n", |
62 | 66 | "\n",
|
63 | 67 | "CPython 3.7.3\n",
|
64 | 68 | "IPython 6.2.1\n",
|
65 | 69 | "\n",
|
66 |
| - "numpy 1.16.2\n", |
67 |
| - "matplotlib 3.1.0\n", |
68 |
| - "pandas 0.24.2\n", |
69 |
| - "\n", |
70 | 70 | "compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
|
71 | 71 | "system : Darwin\n",
|
72 |
| - "release : 18.7.0\n", |
| 72 | + "release : 19.0.0\n", |
73 | 73 | "machine : x86_64\n",
|
74 | 74 | "processor : i386\n",
|
75 | 75 | "CPU cores : 8\n",
|
76 |
| - "interpreter: 64bit\n" |
| 76 | + "interpreter: 64bit\n", |
| 77 | + "Git hash : 17b4024f04091f8fdc1ee8a8e6705838976550c3\n" |
77 | 78 | ]
|
78 | 79 | }
|
79 | 80 | ],
|
80 | 81 | "source": [
|
81 |
| - "%watermark -n -v -m -p numpy,matplotlib,pandas" |
| 82 | + "%watermark -n -v -m -g -iv" |
82 | 83 | ]
|
83 | 84 | },
|
84 | 85 | {
|
|
129 | 130 | {
|
130 | 131 | "data": {
|
131 | 132 | "text/plain": [
|
132 |
| - "[<matplotlib.lines.Line2D at 0x11d7d7ba8>]" |
| 133 | + "[<matplotlib.lines.Line2D at 0x11f38b0b8>]" |
133 | 134 | ]
|
134 | 135 | },
|
135 | 136 | "execution_count": 5,
|
|
168 | 169 | {
|
169 | 170 | "data": {
|
170 | 171 | "text/plain": [
|
171 |
| - "[<matplotlib.lines.Line2D at 0x11da92cf8>]" |
| 172 | + "[<matplotlib.lines.Line2D at 0x11f64a128>]" |
172 | 173 | ]
|
173 | 174 | },
|
174 | 175 | "execution_count": 6,
|
|
207 | 208 | {
|
208 | 209 | "data": {
|
209 | 210 | "text/plain": [
|
210 |
| - "<matplotlib.legend.Legend at 0x11dae4780>" |
| 211 | + "<matplotlib.legend.Legend at 0x11f690438>" |
211 | 212 | ]
|
212 | 213 | },
|
213 | 214 | "execution_count": 7,
|
|
247 | 248 | {
|
248 | 249 | "data": {
|
249 | 250 | "text/plain": [
|
250 |
| - "<matplotlib.legend.Legend at 0x11de03860>" |
| 251 | + "<matplotlib.legend.Legend at 0x11f86ec88>" |
251 | 252 | ]
|
252 | 253 | },
|
253 | 254 | "execution_count": 8,
|
|
446 | 447 | {
|
447 | 448 | "data": {
|
448 | 449 | "text/plain": [
|
449 |
| - "<matplotlib.axes._subplots.AxesSubplot at 0x11fea4048>" |
| 450 | + "<matplotlib.axes._subplots.AxesSubplot at 0x121a5a828>" |
450 | 451 | ]
|
451 | 452 | },
|
452 | 453 | "execution_count": 13,
|
|
528 | 529 | {
|
529 | 530 | "data": {
|
530 | 531 | "text/plain": [
|
531 |
| - "<matplotlib.legend.Legend at 0x120217d68>" |
| 532 | + "<matplotlib.legend.Legend at 0x121dbe390>" |
532 | 533 | ]
|
533 | 534 | },
|
534 | 535 | "execution_count": 15,
|
|
603 | 604 | {
|
604 | 605 | "data": {
|
605 | 606 | "text/plain": [
|
606 |
| - "<matplotlib.legend.Legend at 0x11da226d8>" |
| 607 | + "<matplotlib.legend.Legend at 0x1220e4860>" |
607 | 608 | ]
|
608 | 609 | },
|
609 | 610 | "execution_count": 17,
|
|
660 | 661 | {
|
661 | 662 | "data": {
|
662 | 663 | "text/plain": [
|
663 |
| - "<matplotlib.legend.Legend at 0x12085fc50>" |
| 664 | + "<matplotlib.legend.Legend at 0x122416128>" |
664 | 665 | ]
|
665 | 666 | },
|
666 | 667 | "execution_count": 18,
|
|
717 | 718 | "cell_type": "markdown",
|
718 | 719 | "metadata": {},
|
719 | 720 | "source": [
|
720 |
| - "We'll plot these three datasets using both bar and pie plots. " |
| 721 | + "We'll plot these three datasets using both bar and pie plots. As we want to make sure we use the same colors for the corresponding bar/slice, we start by explicitly obtaining the color cycle" |
721 | 722 | ]
|
722 | 723 | },
|
723 | 724 | {
|
724 | 725 | "cell_type": "code",
|
725 | 726 | "execution_count": 20,
|
726 | 727 | "metadata": {},
|
| 728 | + "outputs": [], |
| 729 | + "source": [ |
| 730 | + "colors = plt.rcParams['axes.prop_cycle'].by_key()['color']" |
| 731 | + ] |
| 732 | + }, |
| 733 | + { |
| 734 | + "cell_type": "markdown", |
| 735 | + "metadata": {}, |
| 736 | + "source": [ |
| 737 | + "Now we can supply the right color sequence to use for the bars" |
| 738 | + ] |
| 739 | + }, |
| 740 | + { |
| 741 | + "cell_type": "code", |
| 742 | + "execution_count": 21, |
| 743 | + "metadata": {}, |
727 | 744 | "outputs": [
|
728 | 745 | {
|
729 | 746 | "data": {
|
730 | 747 | "text/plain": [
|
731 | 748 | "(0, 25)"
|
732 | 749 | ]
|
733 | 750 | },
|
734 |
| - "execution_count": 20, |
| 751 | + "execution_count": 21, |
735 | 752 | "metadata": {},
|
736 | 753 | "output_type": "execute_result"
|
737 | 754 | },
|
|
749 | 766 | }
|
750 | 767 | ],
|
751 | 768 | "source": [
|
752 |
| - "prop_cycle = plt.rcParams['axes.prop_cycle']\n", |
753 |
| - "colors = prop_cycle.by_key()['color']\n", |
754 |
| - "\n", |
755 | 769 | "fig, axs = plt.subplots(nrows=2, ncols=3)\n",
|
756 | 770 | "fig.set_size_inches(14,10)\n",
|
757 | 771 | "\n",
|
|
785 | 799 | },
|
786 | 800 | {
|
787 | 801 | "cell_type": "code",
|
788 |
| - "execution_count": 21, |
| 802 | + "execution_count": 22, |
789 | 803 | "metadata": {},
|
790 | 804 | "outputs": [
|
791 | 805 | {
|
|
794 | 808 | "<BarContainer object of 1 artists>"
|
795 | 809 | ]
|
796 | 810 | },
|
797 |
| - "execution_count": 21, |
| 811 | + "execution_count": 22, |
798 | 812 | "metadata": {},
|
799 | 813 | "output_type": "execute_result"
|
800 | 814 | },
|
|
835 | 849 | },
|
836 | 850 | {
|
837 | 851 | "cell_type": "code",
|
838 |
| - "execution_count": 22, |
| 852 | + "execution_count": 23, |
839 | 853 | "metadata": {},
|
840 | 854 | "outputs": [
|
841 | 855 | {
|
|
893 | 907 | },
|
894 | 908 | {
|
895 | 909 | "cell_type": "code",
|
896 |
| - "execution_count": 23, |
| 910 | + "execution_count": 24, |
897 | 911 | "metadata": {},
|
898 | 912 | "outputs": [],
|
899 | 913 | "source": [
|
|
909 | 923 | },
|
910 | 924 | {
|
911 | 925 | "cell_type": "code",
|
912 |
| - "execution_count": 24, |
| 926 | + "execution_count": 25, |
913 | 927 | "metadata": {},
|
914 | 928 | "outputs": [],
|
915 | 929 | "source": [
|
|
937 | 951 | },
|
938 | 952 | {
|
939 | 953 | "cell_type": "code",
|
940 |
| - "execution_count": 25, |
| 954 | + "execution_count": 26, |
941 | 955 | "metadata": {},
|
942 | 956 | "outputs": [
|
943 | 957 | {
|
|
1022 | 1036 | "4 Burkina Faso 1217.032994 14326203 52.295 0"
|
1023 | 1037 | ]
|
1024 | 1038 | },
|
1025 |
| - "execution_count": 25, |
| 1039 | + "execution_count": 26, |
1026 | 1040 | "metadata": {},
|
1027 | 1041 | "output_type": "execute_result"
|
1028 | 1042 | }
|
|
1047 | 1061 | },
|
1048 | 1062 | {
|
1049 | 1063 | "cell_type": "code",
|
1050 |
| - "execution_count": 26, |
| 1064 | + "execution_count": 27, |
1051 | 1065 | "metadata": {},
|
1052 | 1066 | "outputs": [
|
1053 | 1067 | {
|
|
1109 | 1123 | },
|
1110 | 1124 | {
|
1111 | 1125 | "cell_type": "code",
|
1112 |
| - "execution_count": 27, |
| 1126 | + "execution_count": 28, |
1113 | 1127 | "metadata": {},
|
1114 | 1128 | "outputs": [],
|
1115 | 1129 | "source": [
|
|
1125 | 1139 | },
|
1126 | 1140 | {
|
1127 | 1141 | "cell_type": "code",
|
1128 |
| - "execution_count": 28, |
| 1142 | + "execution_count": 29, |
1129 | 1143 | "metadata": {},
|
1130 | 1144 | "outputs": [
|
1131 | 1145 | {
|
|
1210 | 1224 | "4 40 - 50 28289 45107 -45107 4"
|
1211 | 1225 | ]
|
1212 | 1226 | },
|
1213 |
| - "execution_count": 28, |
| 1227 | + "execution_count": 29, |
1214 | 1228 | "metadata": {},
|
1215 | 1229 | "output_type": "execute_result"
|
1216 | 1230 | }
|
|
1221 | 1235 | },
|
1222 | 1236 | {
|
1223 | 1237 | "cell_type": "code",
|
1224 |
| - "execution_count": 29, |
| 1238 | + "execution_count": 30, |
1225 | 1239 | "metadata": {},
|
1226 | 1240 | "outputs": [
|
1227 | 1241 | {
|
|
1278 | 1292 | },
|
1279 | 1293 | {
|
1280 | 1294 | "cell_type": "code",
|
1281 |
| - "execution_count": 30, |
| 1295 | + "execution_count": 31, |
1282 | 1296 | "metadata": {},
|
1283 | 1297 | "outputs": [],
|
1284 | 1298 | "source": [
|
|
1294 | 1308 | },
|
1295 | 1309 | {
|
1296 | 1310 | "cell_type": "code",
|
1297 |
| - "execution_count": 31, |
| 1311 | + "execution_count": 32, |
1298 | 1312 | "metadata": {},
|
1299 | 1313 | "outputs": [
|
1300 | 1314 | {
|
1301 | 1315 | "data": {
|
1302 | 1316 | "text/plain": [
|
1303 |
| - "<matplotlib.image.AxesImage at 0x10b4cd668>" |
| 1317 | + "<matplotlib.image.AxesImage at 0x123637c18>" |
1304 | 1318 | ]
|
1305 | 1319 | },
|
1306 |
| - "execution_count": 31, |
| 1320 | + "execution_count": 32, |
1307 | 1321 | "metadata": {},
|
1308 | 1322 | "output_type": "execute_result"
|
1309 | 1323 | },
|
|
1333 | 1347 | },
|
1334 | 1348 | {
|
1335 | 1349 | "cell_type": "code",
|
1336 |
| - "execution_count": 32, |
| 1350 | + "execution_count": 33, |
1337 | 1351 | "metadata": {},
|
1338 | 1352 | "outputs": [
|
1339 | 1353 | {
|
|
1357 | 1371 | },
|
1358 | 1372 | {
|
1359 | 1373 | "cell_type": "code",
|
1360 |
| - "execution_count": 33, |
| 1374 | + "execution_count": 34, |
1361 | 1375 | "metadata": {},
|
1362 | 1376 | "outputs": [
|
1363 | 1377 | {
|
|
1401 | 1415 | },
|
1402 | 1416 | {
|
1403 | 1417 | "cell_type": "code",
|
1404 |
| - "execution_count": 34, |
| 1418 | + "execution_count": 35, |
1405 | 1419 | "metadata": {},
|
1406 | 1420 | "outputs": [
|
1407 | 1421 | {
|
|
1428 | 1442 | },
|
1429 | 1443 | {
|
1430 | 1444 | "cell_type": "code",
|
1431 |
| - "execution_count": 35, |
| 1445 | + "execution_count": 36, |
1432 | 1446 | "metadata": {},
|
1433 | 1447 | "outputs": [
|
1434 | 1448 | {
|
|
1459 | 1473 | },
|
1460 | 1474 | {
|
1461 | 1475 | "cell_type": "code",
|
1462 |
| - "execution_count": 36, |
| 1476 | + "execution_count": 37, |
1463 | 1477 | "metadata": {},
|
1464 | 1478 | "outputs": [],
|
1465 | 1479 | "source": [
|
|
1511 | 1525 | },
|
1512 | 1526 | {
|
1513 | 1527 | "cell_type": "code",
|
1514 |
| - "execution_count": 37, |
| 1528 | + "execution_count": 38, |
1515 | 1529 | "metadata": {},
|
1516 | 1530 | "outputs": [
|
1517 | 1531 | {
|
|
0 commit comments