Skip to content

Commit

Permalink
Merge pull request #21389 from jatin837/unused-pxl-coord
Browse files Browse the repository at this point in the history
Log pixel coordinates in event_handling coords_demo example on terminal/console
  • Loading branch information
dstansby committed Oct 20, 2021
2 parents df12d8c + 8955d02 commit a1eef38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/event_handling/coords_demo.py
Expand Up @@ -18,11 +18,12 @@


def on_move(event):
# get the x and y pixel coords
x, y = event.x, event.y
if event.inaxes:
# get the x and y pixel coords
x, y = event.x, event.y
ax = event.inaxes # the axes instance
print('data coords %f %f' % (event.xdata, event.ydata))
print('data coords %f %f, pixel coords %f %f'
% (event.xdata, event.ydata, x, y))


def on_click(event):
Expand Down

0 comments on commit a1eef38

Please sign in to comment.