From b7d94058304f280b619b25e2bff88d111362a08c Mon Sep 17 00:00:00 2001 From: Andrew <15331990+ahuang11@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:29:01 -0700 Subject: [PATCH 1/5] Change note I think it's more impressive if it works on the website --- overview/xarray-in-45-min.ipynb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/overview/xarray-in-45-min.ipynb b/overview/xarray-in-45-min.ipynb index 867561db..6686447f 100644 --- a/overview/xarray-in-45-min.ipynb +++ b/overview/xarray-in-45-min.ipynb @@ -1106,16 +1106,7 @@ "source": [ "import hvplot.xarray\n", "\n", - "ds.air.hvplot(groupby=\"time\", clim=(270, 300), widget_location='bottom')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "```{note}\n", - "The time slider will only work if you're executing the notebook, rather than viewing the website\n", - "```" + "ds.isel(time=slice(0, 10)).air.hvplot(groupby=\"time\", clim=(270, 300), widget_location='bottom', dynamic=False)" ] }, { From 7ce74b2fd0615f826a7deede1f7226ee9ffcca22 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 22:30:26 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- overview/xarray-in-45-min.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overview/xarray-in-45-min.ipynb b/overview/xarray-in-45-min.ipynb index 6686447f..032ad197 100644 --- a/overview/xarray-in-45-min.ipynb +++ b/overview/xarray-in-45-min.ipynb @@ -1106,7 +1106,9 @@ "source": [ "import hvplot.xarray\n", "\n", - "ds.isel(time=slice(0, 10)).air.hvplot(groupby=\"time\", clim=(270, 300), widget_location='bottom', dynamic=False)" + "ds.isel(time=slice(0, 10)).air.hvplot(\n", + " groupby=\"time\", clim=(270, 300), widget_location='bottom', dynamic=False\n", + ")" ] }, { From 93dcdbd462c3fc22f58c7f49003941f0487b8465 Mon Sep 17 00:00:00 2001 From: Andrew <15331990+ahuang11@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:04:08 -0700 Subject: [PATCH 3/5] Change to line plot --- overview/xarray-in-45-min.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/overview/xarray-in-45-min.ipynb b/overview/xarray-in-45-min.ipynb index 032ad197..ec45424d 100644 --- a/overview/xarray-in-45-min.ipynb +++ b/overview/xarray-in-45-min.ipynb @@ -1105,9 +1105,16 @@ "outputs": [], "source": [ "import hvplot.xarray\n", + "import xarray as xr\n", "\n", - "ds.isel(time=slice(0, 10)).air.hvplot(\n", - " groupby=\"time\", clim=(270, 300), widget_location='bottom', dynamic=False\n", + "ds = xr.tutorial.open_dataset(\"air_temperature\")\n", + "ds.mean(\"time\").hvplot(\n", + " groupby=\"lat\",\n", + " hover=\"vline\",\n", + " responsive=True,\n", + " dynamic=False,\n", + " ylim=(240, 310),\n", + " min_height=350,\n", ")" ] }, From e5f2b8d04e34ef1e706350cf27547b9f1de418f3 Mon Sep 17 00:00:00 2001 From: Andrew <15331990+ahuang11@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:04:34 -0700 Subject: [PATCH 4/5] Remove import --- overview/xarray-in-45-min.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/overview/xarray-in-45-min.ipynb b/overview/xarray-in-45-min.ipynb index ec45424d..e36377b0 100644 --- a/overview/xarray-in-45-min.ipynb +++ b/overview/xarray-in-45-min.ipynb @@ -1105,9 +1105,7 @@ "outputs": [], "source": [ "import hvplot.xarray\n", - "import xarray as xr\n", "\n", - "ds = xr.tutorial.open_dataset(\"air_temperature\")\n", "ds.mean(\"time\").hvplot(\n", " groupby=\"lat\",\n", " hover=\"vline\",\n", From 38e88b58f4599f68ad322b4a2dfda5083d2703c1 Mon Sep 17 00:00:00 2001 From: Andrew <15331990+ahuang11@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:06:33 -0700 Subject: [PATCH 5/5] Groupby two dims instead --- overview/xarray-in-45-min.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overview/xarray-in-45-min.ipynb b/overview/xarray-in-45-min.ipynb index e36377b0..35a84cd6 100644 --- a/overview/xarray-in-45-min.ipynb +++ b/overview/xarray-in-45-min.ipynb @@ -1106,8 +1106,8 @@ "source": [ "import hvplot.xarray\n", "\n", - "ds.mean(\"time\").hvplot(\n", - " groupby=\"lat\",\n", + "ds.groupby(\"time.season\").mean().hvplot(\n", + " groupby=[\"season\", \"lat\"],\n", " hover=\"vline\",\n", " responsive=True,\n", " dynamic=False,\n",