Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Oct 18, 2023
1 parent 780aaec commit a7c2787
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions notebooks/wp5/ocean_color_timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@
" \"marker\": \".\",\n",
" }\n",
" kwargs_running = {\n",
" \"label\": \"48-month running\",\n",
" \"color\": \"tab:red\",\n",
" \"ls\": \"--\",\n",
" \"marker\": \" \",\n",
" \"label\": \"48-month running\",\n",
" }\n",
" kwargs_slope = {\n",
" \"label\": \"yearly slope\",\n",
" \"color\": \"tab:blue\",\n",
" \"ls\": \"-\",\n",
" \"marker\": \" \",\n",
" \"label\": \"yearly slope\",\n",
" }\n",
"\n",
" da_daily = da.resample(time=\"D\").mean()\n",
Expand All @@ -219,7 +219,7 @@
" if not col:\n",
" *_, slope, intercept = mk.original_test(da_yearly.squeeze())\n",
"\n",
" da_running.plot(**kwargs_running)\n",
" da_running.plot(add_legend=False, **kwargs_running)\n",
" plt.plot(\n",
" da_yearly[\"time\"],\n",
" np.arange(da_yearly.sizes[\"time\"]) * slope + intercept,\n",
Expand All @@ -232,7 +232,7 @@
" for i, (ax, sel_dict) in enumerate(\n",
" zip(plt_obj.axs.flatten(), plt_obj.name_dicts.flatten())\n",
" ):\n",
" da_running.sel(sel_dict).plot(ax=ax, **kwargs_running)\n",
" da_running.sel(sel_dict).plot(ax=ax, add_legend=False, **kwargs_running)\n",
"\n",
" *_, slope, intercept = mk.original_test(da_yearly.sel(sel_dict))\n",
" ax.plot(\n",
Expand All @@ -241,10 +241,11 @@
" **kwargs_slope,\n",
" )\n",
"\n",
" ax.grid()\n",
" if i:\n",
" ax.set_ylabel(\"\")\n",
" ax.legend()\n",
" ax.grid()\n",
"\n",
" ax.legend(bbox_to_anchor=(1, 1), loc=\"upper left\")\n",
" return plt_obj"
]
},
Expand Down

0 comments on commit a7c2787

Please sign in to comment.