{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# imshow(Z)\nDisplay data as an image, i.e., on a 2D regular raster.\n\nSee `~matplotlib.axes.Axes.imshow`.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\nimport numpy as np\n\nplt.style.use('_mpl-gallery-nogrid')\n\n# make data\nX, Y = np.meshgrid(np.linspace(-3, 3, 16), np.linspace(-3, 3, 16))\nZ = (1 - X/2 + X**5 + Y**3) * np.exp(-X**2 - Y**2)\n\n# plot\nfig, ax = plt.subplots()\n\nax.imshow(Z, origin='lower')\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.13.2" } }, "nbformat": 4, "nbformat_minor": 0 }