{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Plotting in polar coordinates\n",
    "\n",
    "A simple example showing how to plot in polar coordinates with\n",
    "matplotlib.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 107812 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "jet = matplotlib.colormaps[\"jet\"]\n",
    "\n",
    "ax = plt.axes((0.025, 0.025, 0.95, 0.95), polar=True)\n",
    "\n",
    "N = 20\n",
    "theta = np.arange(0.0, 2 * np.pi, 2 * np.pi / N)\n",
    "rng = np.random.default_rng()\n",
    "radii = 10 * rng.random(N)\n",
    "width = np.pi / 4 * rng.random(N)\n",
    "bars = plt.bar(theta, radii, width=width, bottom=0.0)\n",
    "\n",
    "for r, bar in zip(radii, bars, strict=True):\n",
    "    bar.set_facecolor(jet(r / 10.0))\n",
    "    bar.set_alpha(0.5)\n",
    "\n",
    "ax.set_xticklabels([])\n",
    "ax.set_yticklabels([])\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
}
