{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Plot and filled plots\n",
    "\n",
    "Simple example of plots and filling between them with matplotlib.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 35240 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "n = 256\n",
    "X = np.linspace(-np.pi, np.pi, n)\n",
    "Y = np.sin(2 * X)\n",
    "\n",
    "plt.axes((0.025, 0.025, 0.95, 0.95))\n",
    "\n",
    "plt.plot(X, Y + 1, color=\"blue\", alpha=1.00)\n",
    "plt.fill_between(X, 1, Y + 1, color=\"blue\", alpha=0.25)\n",
    "\n",
    "plt.plot(X, Y - 1, color=\"blue\", alpha=1.00)\n",
    "plt.fill_between(X, -1, Y - 1, (Y - 1) > -1, color=\"blue\", alpha=0.25)\n",
    "plt.fill_between(X, -1, Y - 1, (Y - 1) < -1, color=\"red\", alpha=0.25)\n",
    "\n",
    "plt.xlim(-np.pi, np.pi)\n",
    "plt.xticks([])\n",
    "plt.ylim(-2.5, 2.5)\n",
    "plt.yticks([])\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "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.12.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
