{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "01295cb6-cc7a-4c6d-94cf-9b0e6cde9fa7",
   "metadata": {
    "tags": [
     "hide"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "sns.set_theme()\n",
    "sns.palettes._patch_colormap_display()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "84880848-0805-4c41-999a-50808b397275",
   "metadata": {},
   "source": [
    "Generate diverging ramps from blue to red through white:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "643b3e07-8365-46e3-b033-af7a2fdcd158",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(240, 20)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5ae53941-d9d9-4b5a-8abc-173911ebee74",
   "metadata": {},
   "source": [
    "Change the center color to be dark:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41f03771-8fb2-46f6-93c5-5a0e28be625c",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(240, 20, center=\"dark\")"
   ]
  },
  {
   "cell_type": "raw",
   "id": "0aeb2402-2cbe-4546-a354-f1f501f762ae",
   "metadata": {},
   "source": [
    "Return a continuous colormap rather than a discrete palette:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "64d335a5-f8b2-433f-a83f-5aeff7db583a",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(240, 20, as_cmap=True)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "77223a07-8492-4056-a0f7-14e133e3ce2c",
   "metadata": {},
   "source": [
    "Increase the amount of separation around the center value:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "82472c1e-4b16-40eb-be1d-480bbd2aa702",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(240, 20, sep=30, as_cmap=True)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "966e8594-b458-414c-a7b0-3e804ce407bf",
   "metadata": {},
   "source": [
    "Use a magenta-to-green palette instead:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a03f8ede-b424-4e06-beb6-cf63c94bcd9e",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(280, 150)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "b3b17689-58e2-4065-9d52-1cf5ebcd4e89",
   "metadata": {},
   "source": [
    "Decrease the saturation of the endpoints:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "02aaa009-f257-4fc7-a2de-40fbb1464490",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(280, 150, s=50)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "db75ca48-ba72-4ca2-8480-bc72c20a70cc",
   "metadata": {},
   "source": [
    "Decrease the lightness of the endpoints:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "89e3bcb1-a17c-4465-830f-46043cb6c322",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.diverging_palette(280, 150, l=35)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4e42452a-a485-43e7-bbc3-338db58e4637",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e19f523f-c2f7-489a-ba00-326810e31a67",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py310",
   "language": "python",
   "name": "py310"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
