Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 23, 2024
1 parent 6dad62d commit ab2f102
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import rcParams, cycler\n",
"from __future__ import annotations\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from matplotlib import cycler, rcParams\n",
"\n",
"plt.ion()"
]
},
Expand All @@ -69,17 +72,20 @@
"data = [np.logspace(0, 1, 100) + np.random.randn(100) + ii for ii in range(N)]\n",
"data = np.array(data).T\n",
"cmap = plt.cm.coolwarm\n",
"rcParams['axes.prop_cycle'] = cycler(color=cmap(np.linspace(0, 1, N)))\n",
"rcParams[\"axes.prop_cycle\"] = cycler(color=cmap(np.linspace(0, 1, N)))\n",
"\n",
"\n",
"from matplotlib.lines import Line2D\n",
"custom_lines = [Line2D([0], [0], color=cmap(0.), lw=4),\n",
" Line2D([0], [0], color=cmap(.5), lw=4),\n",
" Line2D([0], [0], color=cmap(1.), lw=4)]\n",
"\n",
"custom_lines = [\n",
" Line2D([0], [0], color=cmap(0.0), lw=4),\n",
" Line2D([0], [0], color=cmap(0.5), lw=4),\n",
" Line2D([0], [0], color=cmap(1.0), lw=4),\n",
"]\n",
"\n",
"fig, ax = plt.subplots(figsize=(10, 5))\n",
"lines = ax.plot(data)\n",
"ax.legend(custom_lines, ['Cold', 'Medium', 'Hot']);"
"ax.legend(custom_lines, [\"Cold\", \"Medium\", \"Hot\"]);"
]
},
{
Expand Down

0 comments on commit ab2f102

Please sign in to comment.