.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "plot_types/arrays/quiver.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_plot_types_arrays_quiver.py: ================== quiver(X, Y, U, V) ================== See `~matplotlib.axes.Axes.quiver`. .. GENERATED FROM PYTHON SOURCE LINES 8-29 .. image-sg:: /plot_types/arrays/images/sphx_glr_quiver_001.png :alt: quiver :srcset: /plot_types/arrays/images/sphx_glr_quiver_001.png, /plot_types/arrays/images/sphx_glr_quiver_001_2_00x.png 2.00x :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np plt.style.use('_mpl-gallery-nogrid') # make data x = np.linspace(-4, 4, 6) y = np.linspace(-4, 4, 6) X, Y = np.meshgrid(x, y) U = X + Y V = Y - X # plot fig, ax = plt.subplots() ax.quiver(X, Y, U, V, color="C0", angles='xy', scale_units='xy', scale=5, width=.015) ax.set(xlim=(-5, 5), ylim=(-5, 5)) plt.show() .. _sphx_glr_download_plot_types_arrays_quiver.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: quiver.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: quiver.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_