Skip to content

Commit

Permalink
demand/supply color update
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn-chien committed Aug 16, 2024
1 parent 34d0310 commit cff04f6
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 152 deletions.
35 changes: 9 additions & 26 deletions content/01-demand/01-demand.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Solarize_Light2', '_classic_test_patch', '_mpl-gallery', '_mpl-gallery-nogrid', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-v0_8', 'seaborn-v0_8-bright', 'seaborn-v0_8-colorblind', 'seaborn-v0_8-dark', 'seaborn-v0_8-dark-palette', 'seaborn-v0_8-darkgrid', 'seaborn-v0_8-deep', 'seaborn-v0_8-muted', 'seaborn-v0_8-notebook', 'seaborn-v0_8-paper', 'seaborn-v0_8-pastel', 'seaborn-v0_8-poster', 'seaborn-v0_8-talk', 'seaborn-v0_8-ticks', 'seaborn-v0_8-white', 'seaborn-v0_8-whitegrid', 'tableau-colorblind10']\n"
]
}
],
"source": [
"print(plt.style.available)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"cell_id": "211eaf07-febe-480e-9d9d-f7152cca2a4f",
"tags": [
Expand Down Expand Up @@ -123,8 +106,8 @@
"ardy = 0\n",
"\n",
"fig = plt.figure(figsize=[7,7])\n",
"plt.plot(xs, ys, label=\"Original Demand Curve\", linestyle='-', linewidth=2)\n",
"plt.plot(xs, ys2, label=\"Shifted Demand Curve\", linestyle='--', linewidth=2)\n",
"plt.plot(xs, ys, label=\"Original Demand Curve\", linewidth=2)\n",
"plt.plot(xs, ys2, label=\"Shifted Demand Curve\", linestyle=\"dashed\", linewidth=2, color=\"#049348\")\n",
"plt.arrow(arx, ary, ardx, ardy, head_width=0.8, head_length=0.5, length_includes_head=True)\n",
"plt.xticks([])\n",
"plt.yticks([])\n",
Expand Down Expand Up @@ -173,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {
"tags": [
"remove_input"
Expand All @@ -188,17 +171,17 @@
"q_2, p_2 = 8, -16\n",
"\n",
"fig = plt.figure(figsize=[7,7])\n",
"plt.plot(xs, ys)\n",
"plt.plot(xs, ys, color=\"#1F578E\")\n",
"plt.scatter([q_1, q_2], [p_1, p_2], s=200, color=\"g\", zorder=15)\n",
"plt.arrow(q_1, p_1, q_2 - q_1, p_2 - p_1, color=\"tab:orange\", width=.1, head_length=1.5, head_width=0.5, length_includes_head=True, zorder=-1)\n",
"plt.arrow(q_1, p_1, q_2 - q_1, p_2 - p_1, color=\"#CB7432\", width=.1, head_length=1.5, head_width=0.5, length_includes_head=True, zorder=-1)\n",
"\n",
"# (q_1, p_1)\n",
"plt.vlines(q_1, -1000, p_1, linestyle=\"dashed\")\n",
"plt.hlines(p_1, -1000, q_1, linestyle=\"dashed\")\n",
"plt.vlines(q_1, -1000, p_1, linestyle=\"dashed\", color=\"#1F578E\")\n",
"plt.hlines(p_1, -1000, q_1, linestyle=\"dashed\", color=\"#1F578E\")\n",
"\n",
"# (q_2, p_2)\n",
"plt.vlines(q_2, -1000, p_2, linestyle=\"dashed\")\n",
"plt.hlines(p_2, -1000, q_2, linestyle=\"dashed\")\n",
"plt.vlines(q_2, -1000, p_2, linestyle=\"dashed\", color=\"#1F578E\")\n",
"plt.hlines(p_2, -1000, q_2, linestyle=\"dashed\", color=\"#1F578E\")\n",
"\n",
"plt.xticks([q_1, q_2], [r\"$q_1$\", r\"$q_2$\"], size=14)\n",
"plt.yticks([p_1, p_2], [r\"$p_1$\", r\"$p_2$\"], size=14)\n",
Expand Down
Binary file modified content/01-demand/fig-01-demand-orig-shifted-demand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/01-demand/fig-01-demand-q1-p1-q2-p2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 77 additions & 76 deletions content/02-supply/01-supply.ipynb

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions content/02-supply/04-market-equilibria.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {
"tags": [
"remove_cell"
Expand All @@ -16,7 +16,7 @@
"import matplotlib.pyplot as plt\n",
"import matplotlib as mpl\n",
"import matplotlib.patches as patches\n",
"plt.style.use('seaborn-muted')\n",
"# plt.style.use('seaborn-muted')\n",
"mpl.rcParams['figure.dpi'] = 200\n",
"%matplotlib inline\n",
"\n",
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"cell_id": "5a6c6746-bad6-466e-8c18-bc16f5fad344"
},
Expand Down Expand Up @@ -154,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": null,
"metadata": {
"cell_id": "b75d49b7-7c34-4c8a-a844-e16f26940df7"
},
Expand Down Expand Up @@ -239,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": null,
"metadata": {
"cell_id": "254b8839-cf4f-460b-a597-c267ad6ebb84"
},
Expand Down Expand Up @@ -330,7 +330,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": null,
"metadata": {
"cell_id": "b7a2e982-d79e-4094-a295-d8edea5e3c12"
},
Expand Down Expand Up @@ -375,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": null,
"metadata": {
"cell_id": "42bf023c-0b5a-4f12-8158-dcf58f137185"
},
Expand Down Expand Up @@ -415,7 +415,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": null,
"metadata": {
"cell_id": "d06b28f9-96eb-480c-8a10-3ba4981be472"
},
Expand Down Expand Up @@ -455,7 +455,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": null,
"metadata": {
"cell_id": "f9654557-6972-4ba9-948b-f7ff7a48a61f"
},
Expand Down Expand Up @@ -504,7 +504,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -548,7 +548,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": null,
"metadata": {
"cell_id": "6e28af89-0a83-465e-bb24-d7e66c9b978e"
},
Expand Down Expand Up @@ -596,7 +596,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -623,7 +623,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": null,
"metadata": {
"cell_id": "f5d296fd-a13d-4b0b-a22d-a22806cb498c",
"tags": [
Expand Down Expand Up @@ -736,7 +736,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
66 changes: 30 additions & 36 deletions content/06-inequality/inequality.ipynb

Large diffs are not rendered by default.

0 comments on commit cff04f6

Please sign in to comment.