ginput

In [1]:
# Might have to execute this block TWICE (for some reason)
import numpy as np
from scipy.interpolate import make_interp_spline
import matplotlib.pyplot as plt

Choose just one of these two

In [2]:
%matplotlib qt
plt.ion()
In [2]:
%matplotlib osx
plt.ion()

Click to enter points

In [10]:
# Create a figure, possible displaying your desired curve.
plt.figure(1)
f = plt.imread('spade.jpg'); plt.imshow(f);
#plt.plot([0,1],[0,1], 'w.')
In [11]:
# To stop it...
# - on macbook, alt-click
# - on Windows, hit RETURN
c = plt.ginput(10, mouse_stop=2)
plt.draw()

And here is where you clicked...

In [12]:
c
Out[12]:
[(192.64880952380955, 35.3214285714285),
 (214.9107142857143, 57.58333333333326),
 (247.79761904761912, 103.62499999999994),
 (296.8750000000001, 167.88095238095235),
 (303.4523809523811, 274.63690476190476),
 (252.85714285714292, 281.7202380952381),
 (177.9761904761905, 232.13690476190473),
 (161.2797619047619, 156.74999999999994),
 (168.86904761904762, 153.20833333333331)]
In [ ]: