Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6e0ee4

Browse files
authored
Merge pull request#21389 from jatin837/unused-pxl-coord
Log pixel coordinates in event_handling coords_demo example on terminal/console
2 parents9fb5370 +f96c73c commitf6e0ee4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎examples/event_handling/coords_demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919

2020
defon_move(event):
21-
# get the x and y pixel coords
22-
x,y=event.x,event.y
2321
ifevent.inaxes:
22+
# get the x and y pixel coords
23+
x,y=event.x,event.y
2424
ax=event.inaxes# the axes instance
25-
print('data coords %f %f'% (event.xdata,event.ydata))
25+
print('data coords %f %f, pixel coords %f %f'
26+
% (event.xdata,event.ydata,x,y))
2627

2728

2829
defon_click(event):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp