You are reading an old version of the documentation (v1.5.0). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: geo_demo.py

Next topic

pylab_examples example code: ginput_manual_clabel.py

This Page

pylab_examples example code: ginput_demo.pyΒΆ

[source code]

# -*- 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 Search examples)