Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48b48ad

Browse files
committed
bug fixes as requested
1 parent e43512e commit 48b48ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/pylab_examples/cursor_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def mouse_move(self, event):
5757

5858
x, y = event.xdata, event.ydata
5959

60-
indx = searchsorted(self.x, [x])[0]
60+
indx = np.searchsorted(self.x, [x])[0]
6161
x = self.x[indx]
6262
y = self.y[indx]
6363
# update the line positions
@@ -66,7 +66,7 @@ def mouse_move(self, event):
6666

6767
self.txt.set_text('x=%1.2f, y=%1.2f' % (x, y))
6868
print('x=%1.2f, y=%1.2f' % (x, y))
69-
draw()
69+
plt.draw()
7070

7171
t = np.arange(0.0, 1.0, 0.01)
7272
s = np.sin(2*2*np.pi*t)

0 commit comments

Comments
 (0)