From e38db5340eff31501a6a2c660590f63f4f5e3fbe Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Thu, 19 Oct 2023 13:01:06 +0200 Subject: [PATCH] cleanup --- notebooks/wp5/ocean_color_timeseries.ipynb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/notebooks/wp5/ocean_color_timeseries.ipynb b/notebooks/wp5/ocean_color_timeseries.ipynb index 2d26973..ba51e49 100644 --- a/notebooks/wp5/ocean_color_timeseries.ipynb +++ b/notebooks/wp5/ocean_color_timeseries.ipynb @@ -221,10 +221,13 @@ " \"MERIS\": [\"2002-03-01\", \"2012-04-30\"],\n", " }\n", " for i, (mission, xlims) in enumerate(missions.items()):\n", + " xlims = pd.to_datetime(xlims).tolist()\n", + " facecolor = matplotlib.colors.colorConverter.to_rgba(f\"C{i}\", alpha=0.2)\n", + " edgecolor = matplotlib.colors.colorConverter.to_rgba(f\"C{i}\", alpha=1)\n", " plt.axvspan(\n", - " *pd.to_datetime(xlims).tolist(),\n", - " facecolor=matplotlib.colors.colorConverter.to_rgba(f\"C{i}\", alpha=0.2),\n", - " edgecolor=matplotlib.colors.colorConverter.to_rgba(f\"C{i}\", alpha=1),\n", + " *xlims,\n", + " facecolor=facecolor,\n", + " edgecolor=edgecolor,\n", " lw=1.5,\n", " ls=\"--\",\n", " label=mission,\n", @@ -232,7 +235,7 @@ "\n", " # Final settings\n", " ax.set_ylim(da.quantile([0.01, 0.99]).values.tolist())\n", - " plt.legend()\n", + " plt.legend(loc=\"top left\", bbox_to_anchor=(1, 1))\n", " plt.grid()\n", " return fig, ax" ]