3
我有2個圖形和一個鼠標運動功能,打印出他們的畫布的座標。我怎樣才能使鼠標運動函數只在鼠標懸停在其中一個圖表上時被調用。2圖鼠標運動matplotlib
self.ax.imshow(matrix,cmap=plt.cm.Greys_r, interpolation='none')
self.ax.imshow(matrix2,cmap=plt.cm.Greys_r, interpolation='none')
def motion_capture(event)
print event.xdata
print event.ydata
self.canvas = FigureCanvas(self,-1,self.fig)
self.canvas.mpl.connect('Motion', motion_capture)
此刻當鼠標沿畫布移動該被調用時,如果它不是在任圖表none
被印刷爲座標。我怎樣才能做到這一點,所以它只被稱爲其中一個圖表
您可以連接並在此基礎上軸鼠標斷開你的動作捕捉功能已經進入/左(其自身是連接,能事件) – RodericDay 2013-03-08 16:24:53