

.. _sphx_glr_gallery_images_contours_and_fields_quiver_simple_demo.py:


==================
Quiver Simple Demo
==================

A simple example of a quiver plot with a quiverkey.




.. image:: /gallery/images_contours_and_fields/images/sphx_glr_quiver_simple_demo_001.png
    :align: center





.. 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()

**Total running time of the script:** ( 0 minutes  0.036 seconds)



.. container:: sphx-glr-footer


  .. container:: sphx-glr-download

     :download:`Download Python source code: quiver_simple_demo.py <quiver_simple_demo.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: quiver_simple_demo.ipynb <quiver_simple_demo.ipynb>`

.. rst-class:: sphx-glr-signature

    `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
