From 25cea980ea0a42bcc6f86c1176a1197b3f4c5b72 Mon Sep 17 00:00:00 2001 From: Martin Vonk Date: Mon, 11 Nov 2024 11:33:11 +0100 Subject: [PATCH] rename si_heatmap to heatmap --- .../example05_multiyear_drought.ipynb | 24 +++++++++---------- src/spei/plot.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/examples/example05_multiyear_drought.ipynb b/doc/examples/example05_multiyear_drought.ipynb index 77907ed..793e926 100644 --- a/doc/examples/example05_multiyear_drought.ipynb +++ b/doc/examples/example05_multiyear_drought.ipynb @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -122,7 +122,7 @@ "(12784.0, 16436.0)" ] }, - "execution_count": 13, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" }, @@ -167,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -176,7 +176,7 @@ "(14610.0, 16436.0)" ] }, - "execution_count": 14, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, @@ -192,7 +192,7 @@ } ], "source": [ - "ax = si.plot.si_heatmap([spei1, spei3, spei6, spei9, spei12, spei24])\n", + "ax = si.plot.heatmap([spei1, spei3, spei6, spei9, spei12, spei24])\n", "ax.xaxis.set_major_locator(mpl.dates.YearLocator())\n", "ax.xaxis.set_minor_locator(mpl.dates.MonthLocator())\n", "ax.get_figure().axes[-1].set_yticks(range(-3, 0))\n", @@ -208,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -217,7 +217,7 @@ "(14610.0, 16436.0)" ] }, - "execution_count": 15, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, @@ -233,7 +233,7 @@ } ], "source": [ - "ax = si.plot.si_heatmap(\n", + "ax = si.plot.heatmap(\n", " [spei1, spei3, spei6, spei9, spei12, spei24], cmap=\"vik_r\", vmax=3\n", ")\n", "ax.xaxis.set_major_locator(mpl.dates.YearLocator())\n", @@ -244,7 +244,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "spei-env--196-leg-py3.10", "language": "python", "name": "python3" }, diff --git a/src/spei/plot.py b/src/spei/plot.py index a1bf1b8..82f05df 100644 --- a/src/spei/plot.py +++ b/src/spei/plot.py @@ -151,7 +151,7 @@ def monthly_density( return ax -def si_heatmap( +def heatmap( sis: List[Series], cmap: str = "Reds_r", vmin: float = -3.0,