.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_images_contours_and_fields_quiver_simple_demo.py: ================== Quiver Simple Demo ================== A simple example of a `~.axes.Axes.quiver` plot with a `~.axes.Axes.quiverkey`. For more advanced options refer to :doc:`/gallery/images_contours_and_fields/quiver_demo`. .. code-block:: python import matplotlib.pyplot as plt import numpy as np X = np.arange(-10, 10, 1) Y = np.arange(-10, 10, 1) U, V = np.meshgrid(X, Y) fig, ax = plt.subplots() q = ax.quiver(X, Y, U, V) ax.quiverkey(q, X=0.3, Y=1.1, U=10, label='Quiver key, length = 10', labelpos='E') plt.show() .. image:: /gallery/images_contours_and_fields/images/sphx_glr_quiver_simple_demo_001.png :class: sphx-glr-single-img ------------ References """""""""" The use of the following functions and methods is shown in this example: .. code-block:: python import matplotlib matplotlib.axes.Axes.quiver matplotlib.pyplot.quiver matplotlib.axes.Axes.quiverkey matplotlib.pyplot.quiverkey .. _sphx_glr_download_gallery_images_contours_and_fields_quiver_simple_demo.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: quiver_simple_demo.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: quiver_simple_demo.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_