{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "flush-block",
   "metadata": {
    "tags": [
     "hide"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "remarkable-confirmation",
   "metadata": {},
   "source": [
    "By default, seaborn plots will be made with the current values of the matplotlib rcParams:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "viral-highway",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.barplot(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "hungarian-poster",
   "metadata": {},
   "source": [
    "Calling this function with no arguments will activate seaborn's \"default\" theme:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "front-february",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.set_theme()\n",
    "sns.barplot(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "daily-mills",
   "metadata": {},
   "source": [
    "Note that this will take effect for *all* matplotlib plots, including those not made using seaborn:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "essential-replica",
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.bar([\"A\", \"B\", \"C\"], [1, 3, 2])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "naughty-edgar",
   "metadata": {},
   "source": [
    "The seaborn theme is decomposed into several distinct sets of parameters that you can control independently:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "latin-conversion",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.set_theme(style=\"whitegrid\", palette=\"pastel\")\n",
    "sns.barplot(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "durable-cycling",
   "metadata": {},
   "source": [
    "Pass `None` to preserve the current values for a given set of parameters:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "blessed-chuck",
   "metadata": {},
   "outputs": [],
   "source": [
    "sns.set_theme(style=\"white\", palette=None)\n",
    "sns.barplot(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "present-writing",
   "metadata": {},
   "source": [
    "You can also override any seaborn parameters or define additional parameters that are part of the matplotlib rc system but not included in the seaborn themes:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "floppy-effectiveness",
   "metadata": {},
   "outputs": [],
   "source": [
    "custom_params = {\"axes.spines.right\": False, \"axes.spines.top\": False}\n",
    "sns.set_theme(style=\"ticks\", rc=custom_params)\n",
    "sns.barplot(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "large-transfer",
   "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
}
