Skip to content

Commit a9ec6aa

Browse files
committed
Inline some code pointed out in review
1 parent 0460cf8 commit a9ec6aa

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

examples/event_handling/coords_demo.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727

2828
def on_move(event):
2929
if event.inaxes:
30-
# get the x and y pixel coords
31-
x, y = event.x, event.y
32-
print('data coords %f %f, pixel coords %f %f'
33-
% (event.xdata, event.ydata, x, y))
30+
print(f'data coords {event.xdata} {event.ydata},',
31+
f'pixel coords {event.x} {event.y}')
3432

3533

3634
def on_click(event):

examples/event_handling/pong_sgskip.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,7 @@ def on_redraw(event):
316316
def start_anim(event):
317317
canvas.mpl_disconnect(start_anim.cid)
318318

319-
def local_draw():
320-
if animation.ax.get_renderer_cache():
321-
animation.draw()
322-
start_anim.timer.add_callback(local_draw)
319+
start_anim.timer.add_callback(animation.draw)
323320
start_anim.timer.start()
324321
canvas.mpl_connect('draw_event', on_redraw)
325322

0 commit comments

Comments
 (0)