{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# GridSpec\n",
    "\n",
    "An example demoing gridspec\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 20196 characters]",
      "text/plain": [
       "<Figure size 600x400 with 5 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import gridspec\n",
    "\n",
    "plt.figure(figsize=(6, 4))\n",
    "G = gridspec.GridSpec(3, 3)\n",
    "\n",
    "axes_1 = plt.subplot(G[0, :])\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "plt.text(0.5, 0.5, \"Axes 1\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n",
    "\n",
    "axes_2 = plt.subplot(G[1, :-1])\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "plt.text(0.5, 0.5, \"Axes 2\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n",
    "\n",
    "axes_3 = plt.subplot(G[1:, -1])\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "plt.text(0.5, 0.5, \"Axes 3\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n",
    "\n",
    "axes_4 = plt.subplot(G[-1, 0])\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "plt.text(0.5, 0.5, \"Axes 4\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n",
    "\n",
    "axes_5 = plt.subplot(G[-1, -2])\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "plt.text(0.5, 0.5, \"Axes 5\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n",
    "\n",
    "plt.tight_layout()\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
}
