{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Plot example vignette\n\nAn example of plots with matplotlib, and added annotations.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nimport matplotlib.pyplot as plt\n\nn = 256\nX = np.linspace(0, 2, n)\nY = np.sin(2 * np.pi * X)\n\nplt.plot(X, Y, lw=2, color=\"violet\")\nplt.xlim(-0.2, 2.2)\nplt.xticks([])\nplt.ylim(-1.2, 1.2)\nplt.yticks([])\n\n\n# Add a title and a box around it\nfrom matplotlib.patches import FancyBboxPatch\n\nax = plt.gca()\nax.add_patch(\n    FancyBboxPatch(\n        (-0.05, 0.87),\n        width=0.66,\n        height=0.165,\n        clip_on=False,\n        boxstyle=\"square,pad=0\",\n        zorder=3,\n        facecolor=\"white\",\n        alpha=1.0,\n        transform=plt.gca().transAxes,\n    )\n)\n\nplt.text(\n    -0.05,\n    1.02,\n    \" Regular Plot:      plt.plot(...)\\n\",\n    horizontalalignment=\"left\",\n    verticalalignment=\"top\",\n    size=\"xx-large\",\n    transform=plt.gca().transAxes,\n)\n\nplt.text(\n    -0.05,\n    1.01,\n    \"\\n\\n   Plot lines and/or markers \",\n    horizontalalignment=\"left\",\n    verticalalignment=\"top\",\n    size=\"large\",\n    transform=plt.gca().transAxes,\n)\n\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "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": 0
}