Skip to content

Commit

Permalink
added style sheet discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtgoncalves committed Dec 2, 2019
1 parent 17b4024 commit 1e6f126
Show file tree
Hide file tree
Showing 7 changed files with 1,903 additions and 1,202 deletions.
100 changes: 57 additions & 43 deletions Part I - Matplotlib.ipynb → 1. Matplotlib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,28 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wed Sep 25 2019 \n",
"watermark 1.8.1\n",
"matplotlib 3.1.0\n",
"numpy 1.16.2\n",
"pandas 0.24.2\n",
"Sun Dec 01 2019 \n",
"\n",
"CPython 3.7.3\n",
"IPython 6.2.1\n",
"\n",
"numpy 1.16.2\n",
"matplotlib 3.1.0\n",
"pandas 0.24.2\n",
"\n",
"compiler : Clang 4.0.1 (tags/RELEASE_401/final)\n",
"system : Darwin\n",
"release : 18.7.0\n",
"release : 19.0.0\n",
"machine : x86_64\n",
"processor : i386\n",
"CPU cores : 8\n",
"interpreter: 64bit\n"
"interpreter: 64bit\n",
"Git hash : 17b4024f04091f8fdc1ee8a8e6705838976550c3\n"
]
}
],
"source": [
"%watermark -n -v -m -p numpy,matplotlib,pandas"
"%watermark -n -v -m -g -iv"
]
},
{
Expand Down Expand Up @@ -129,7 +130,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x11d7d7ba8>]"
"[<matplotlib.lines.Line2D at 0x11f38b0b8>]"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -168,7 +169,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x11da92cf8>]"
"[<matplotlib.lines.Line2D at 0x11f64a128>]"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -207,7 +208,7 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x11dae4780>"
"<matplotlib.legend.Legend at 0x11f690438>"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -247,7 +248,7 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x11de03860>"
"<matplotlib.legend.Legend at 0x11f86ec88>"
]
},
"execution_count": 8,
Expand Down Expand Up @@ -446,7 +447,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x11fea4048>"
"<matplotlib.axes._subplots.AxesSubplot at 0x121a5a828>"
]
},
"execution_count": 13,
Expand Down Expand Up @@ -528,7 +529,7 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x120217d68>"
"<matplotlib.legend.Legend at 0x121dbe390>"
]
},
"execution_count": 15,
Expand Down Expand Up @@ -603,7 +604,7 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x11da226d8>"
"<matplotlib.legend.Legend at 0x1220e4860>"
]
},
"execution_count": 17,
Expand Down Expand Up @@ -660,7 +661,7 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x12085fc50>"
"<matplotlib.legend.Legend at 0x122416128>"
]
},
"execution_count": 18,
Expand Down Expand Up @@ -717,21 +718,37 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We'll plot these three datasets using both bar and pie plots. "
"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"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"colors = plt.rcParams['axes.prop_cycle'].by_key()['color']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we can supply the right color sequence to use for the bars"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0, 25)"
]
},
"execution_count": 20,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
},
Expand All @@ -749,9 +766,6 @@
}
],
"source": [
"prop_cycle = plt.rcParams['axes.prop_cycle']\n",
"colors = prop_cycle.by_key()['color']\n",
"\n",
"fig, axs = plt.subplots(nrows=2, ncols=3)\n",
"fig.set_size_inches(14,10)\n",
"\n",
Expand Down Expand Up @@ -785,7 +799,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 22,
"metadata": {},
"outputs": [
{
Expand All @@ -794,7 +808,7 @@
"<BarContainer object of 1 artists>"
]
},
"execution_count": 21,
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -835,7 +849,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -893,7 +907,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -909,7 +923,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -937,7 +951,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 26,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1022,7 +1036,7 @@
"4 Burkina Faso 1217.032994 14326203 52.295 0"
]
},
"execution_count": 25,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1047,7 +1061,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 27,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1109,7 +1123,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1125,7 +1139,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 29,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1210,7 +1224,7 @@
"4 40 - 50 28289 45107 -45107 4"
]
},
"execution_count": 28,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1221,7 +1235,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 30,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1278,7 +1292,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1294,16 +1308,16 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x10b4cd668>"
"<matplotlib.image.AxesImage at 0x123637c18>"
]
},
"execution_count": 31,
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -1333,7 +1347,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 33,
"metadata": {},
"outputs": [
{
Expand All @@ -1357,7 +1371,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 34,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1401,7 +1415,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 35,
"metadata": {},
"outputs": [
{
Expand All @@ -1428,7 +1442,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 36,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1459,7 +1473,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1511,7 +1525,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 38,
"metadata": {},
"outputs": [
{
Expand Down
Loading

0 comments on commit 1e6f126

Please sign in to comment.