{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# 3D plotting\n",
    "\n",
    "Demo 3D plotting with matplotlib and style the figure.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 22540 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from mpl_toolkits.mplot3d.axes3d import Axes3D, get_test_data\n",
    "\n",
    "ax: Axes3D = plt.figure().add_subplot(projection=\"3d\")\n",
    "X, Y, Z = get_test_data(0.05)\n",
    "cset = ax.contourf(X, Y, Z)\n",
    "ax.clabel(cset, fontsize=9, inline=1)\n",
    "\n",
    "plt.xticks([])\n",
    "plt.yticks([])\n",
    "ax.set_zticks([])\n",
    "\n",
    "\n",
    "ax.text2D(\n",
    "    -0.05,\n",
    "    1.05,\n",
    "    \" 3D plots             \\n\",\n",
    "    horizontalalignment=\"left\",\n",
    "    verticalalignment=\"top\",\n",
    "    bbox={\"facecolor\": \"white\", \"alpha\": 1.0},\n",
    "    family=\"DejaVu Sans\",\n",
    "    size=\"x-large\",\n",
    "    transform=plt.gca().transAxes,\n",
    ")\n",
    "\n",
    "ax.text2D(\n",
    "    -0.05,\n",
    "    0.975,\n",
    "    \" Plot 2D or 3D data\",\n",
    "    horizontalalignment=\"left\",\n",
    "    verticalalignment=\"top\",\n",
    "    family=\"DejaVu Sans\",\n",
    "    size=\"medium\",\n",
    "    transform=plt.gca().transAxes,\n",
    ")\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
}
