.. _pylab_examples-ginput_demo:

pylab_examples example code: ginput_demo.py
===========================================

[`source code <ginput_demo.py>`_]

::

    # -*- noplot -*-
    
    from __future__ import print_function
    
    import matplotlib.pyplot as plt
    import numpy as np
    t = np.arange(10)
    plt.plot(t, np.sin(t))
    print("Please click")
    x = plt.ginput(3)
    print("clicked", x)
    plt.show()
    

Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)