Skip to content

Commit

Permalink
change colormaps
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Mar 29, 2024
1 parent ccf0e48 commit c43c209
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions notebooks/wp4/extreme_indices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
" \"miroc6\",\n",
" \"mpi_esm1_2_lr\",\n",
" )\n",
" cbars = {\"cmap_divergent\": \"RdBu_r\", \"cmap_sequential\": \"viridis\"}\n",
" case \"precipitation\":\n",
" resample_reduction = \"sum\"\n",
" index_names = (\"CWD\", \"R20mm\", \"RR1\", \"RX1day\", \"RX5day\")\n",
Expand All @@ -166,6 +167,7 @@
" \"miroc6\",\n",
" \"mpi_esm1_2_lr\",\n",
" )\n",
" cbars = {\"cmap_divergent\": \"RdBu\", \"cmap_sequential\": \"viridis_r\"}\n",
" case _:\n",
" raise NotImplementedError(f\"{variable=}\")"
]
Expand Down Expand Up @@ -627,6 +629,7 @@
" figsize=None,\n",
" layout=\"constrained\",\n",
" area=area,\n",
" flip_cmaps=False,\n",
" **kwargs,\n",
"):\n",
" if isinstance(data, dict):\n",
Expand Down Expand Up @@ -683,6 +686,7 @@
" layout=\"constrained\",\n",
" cbar_kwargs=None,\n",
" area=area,\n",
" flip_cmaps=False,\n",
" **kwargs,\n",
"):\n",
" # Get kwargs\n",
Expand Down Expand Up @@ -754,6 +758,22 @@
"common_title = f\"{year_start=} {year_stop=} {collection_id=} {timeseries=}\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Change default colorbars"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"xr.set_options(**cbars)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit c43c209

Please sign in to comment.