In [1]:
import os
import sys
# check the scripts directory is present
if not os.path.exists("../scripts/"):
print "The scripts directory is missing"
sys.exit()
# since the scripts directory is there, try importing the modules
sys.path.append('../scripts')
import dateutil
import qcio
import qcutils
import qcts
import qcplot
import statsmodels.api as sm
In [2]:
import matplotlib.pyplot as plt
In [3]:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title('click on points')
line, = ax.plot(np.random.rand(100), 'o', picker=5) # 5 points tolerance
def onpick(event):
thisline = event.artist
xdata = thisline.get_xdata()
ydata = thisline.get_ydata()
ind = event.ind
print 'onpick points:', zip(xdata[ind], ydata[ind])
fig.canvas.mpl_connect('pick_event', onpick)
plt.show()
In [ ]: