{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Grid\n",
    "\n",
    "Displaying a grid on the axes in matploblib.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 9484 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import ticker\n",
    "\n",
    "ax = plt.axes((0.025, 0.025, 0.95, 0.95))\n",
    "\n",
    "ax.set_xlim(0, 4)\n",
    "ax.set_ylim(0, 3)\n",
    "ax.xaxis.set_major_locator(ticker.MultipleLocator(1.0))\n",
    "ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.1))\n",
    "ax.yaxis.set_major_locator(ticker.MultipleLocator(1.0))\n",
    "ax.yaxis.set_minor_locator(ticker.MultipleLocator(0.1))\n",
    "ax.grid(which=\"major\", axis=\"x\", linewidth=0.75, linestyle=\"-\", color=\"0.75\")\n",
    "ax.grid(which=\"minor\", axis=\"x\", linewidth=0.25, linestyle=\"-\", color=\"0.75\")\n",
    "ax.grid(which=\"major\", axis=\"y\", linewidth=0.75, linestyle=\"-\", color=\"0.75\")\n",
    "ax.grid(which=\"minor\", axis=\"y\", linewidth=0.25, linestyle=\"-\", color=\"0.75\")\n",
    "ax.set_xticklabels([])\n",
    "ax.set_yticklabels([])\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
}
