Skip to content

Commit

Permalink
update graph
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn-chien committed Aug 14, 2024
1 parent db3493c commit 34d0310
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions content/01-demand/01-demand.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"cells": [
{
"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,
Expand All @@ -17,7 +34,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",
"%matplotlib inline\n",
"\n",
"from IPython.display import display\n",
Expand Down Expand Up @@ -88,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {
"tags": [
"remove_input"
Expand All @@ -106,8 +123,8 @@
"ardy = 0\n",
"\n",
"fig = plt.figure(figsize=[7,7])\n",
"plt.plot(xs, ys, label=\"Original Demand Curve\")\n",
"plt.plot(xs, ys2, label=\"Shifted Demand Curve\")\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.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 All @@ -117,7 +134,8 @@
"plt.ylim([-25, 10])\n",
"plt.legend()\n",
"fig.savefig('fig-01-demand-orig-shifted-demand.png', bbox_inches='tight')\n",
"plt.close(fig) \n"
"plt.close(fig)\n",
"plt.show()\n"
]
},
{
Expand Down Expand Up @@ -251,7 +269,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 34d0310

Please sign in to comment.