{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "60aebc68-2c7c-4af5-a159-8421e1f94ba6",
   "metadata": {
    "tags": [
     "hide"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "sns.set_theme()\n",
    "sns.palettes._patch_colormap_display()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "242b3d42-1f10-4da2-9ef9-af06f7fbd724",
   "metadata": {},
   "source": [
    "Return a discrete palette with default parameters:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6526accb-9930-4e39-9f58-1ca2941c1c9d",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "887a40f0-d949-41fa-9a43-0ee246c9a077",
   "metadata": {},
   "source": [
    "Increase the number of colors:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "02833290-b1ee-46df-a2a0-8268fba94628",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(8)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "a9eb86c7-f92e-4422-ae62-a2ef136e7e35",
   "metadata": {},
   "source": [
    "Return a continuous colormap rather than a discrete palette:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a460efc2-cf0a-46bf-a12f-12870afce8a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(as_cmap=True)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5b84aa6c-ad79-45b1-a7d2-44b7ecba5f7d",
   "metadata": {},
   "source": [
    "Change the starting point of the helix:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "70ee079a-e760-4d43-8447-648fd236ab15",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(start=2)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5e21fa22-9ac3-4354-8694-967f2447b286",
   "metadata": {},
   "source": [
    "Change the amount of rotation in the helix:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ddb1b8c7-8933-4317-827f-4f10d2b4cecc",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(rot=.2)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "fa91aff7-54e7-4754-a13c-b629dfc33e8f",
   "metadata": {},
   "source": [
    "Rotate in the reverse direction:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "548a3942-48ae-40d2-abb7-acc2ffd71601",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(rot=-.2)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "e7188a1b-183f-4b04-93a0-975c27fe408e",
   "metadata": {},
   "source": [
    "Apply a nonlinearity to the luminance ramp:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9ced54ff-a396-451e-b17f-2366b56f920b",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(gamma=.5)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "bc82ce48-2df3-464e-b70e-a1d73d0432c6",
   "metadata": {},
   "source": [
    "Increase the saturation of the colors:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a38b91a8-3fdc-4293-a3ea-71b4006cd2a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(hue=1)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "f8d23ba1-013a-489f-94c4-f2080bfdae87",
   "metadata": {},
   "source": [
    "Change the luminance at the start and end points:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a4f05a16-18f0-4c14-99a4-57a0734aad02",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(dark=.25, light=.75)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "0bfcc5d9-05ba-4715-94ac-8d430d9416c2",
   "metadata": {},
   "source": [
    "Reverse the direction of the luminance ramp:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "74563491-5448-42c3-86c5-f5d55ce6924c",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.cubehelix_palette(reverse=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "94a83211-8b8e-4e60-8365-9600e71ddc5d",
   "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
}
