{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# quiver(X, Y, U, V)\nPlot a 2D field of arrows.\n\nSee `~matplotlib.axes.Axes.quiver`.\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 = np.linspace(-4, 4, 6)\ny = np.linspace(-4, 4, 6)\nX, Y = np.meshgrid(x, y)\nU = X + Y\nV = Y - X\n\n# plot\nfig, ax = plt.subplots()\n\nax.quiver(X, Y, U, V, color=\"C0\", angles='xy',\n scale_units='xy', scale=5, width=.015)\n\nax.set(xlim=(-5, 5), ylim=(-5, 5))\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 }