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

Skip to content

Commit c50f2ec

Browse files
committed
finished porting new toolbar
svn path=/trunk/matplotlib/; revision=413
1 parent 57703ef commit c50f2ec

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

.matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
backend : GTKAgg # the default backend
2828
numerix : Numeric # Numeric or numarray
2929
interactive : False # see http://matplotlib.sourceforge.net/interactive.html
30-
toolbar : classic # None | classic | toolbar2 (experimental)
30+
toolbar : toolbar2 # None | classic | toolbar2 (experimental)
3131

3232
# Where your matplotlib data lives if you installed to a non-default
3333
# location. This is where the matplotlib fonts, bitmaps, etc reside

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cNew entries should be added at the top
22

3+
2004-07-20 ported toolbar2 to wx
4+
35
2004-07-20 upgraded to agg21 - JDH
46

57
2004-07-20 Added new icons for toolbar2 - JDH

examples/coords_demo.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,18 @@ def on_move(event):
1616
# get the x and y coords, flip y from top to bottom
1717
x, y = event.x, event.y
1818

19-
if ax.in_axes(x, y):
20-
# transData transforms data coords to display coords. Use the
21-
# inverse method to transform back
22-
print ax.transData.inverse_xy_tup( (x,y) )
19+
if event.inaxes is not None:
20+
print 'data coords', event.xdata, event.ydata
2321

2422
def on_click(event):
2523
# get the x and y coords, flip y from top to bottom
2624
x, y = event.x, event.y
2725
if event.button==1:
28-
if ax.in_axes(x, y):
29-
# transData transforms data coords to display coords. Use the
30-
# inverse method to transform back
31-
print ax.transData.inverse_xy_tup( (x,y) )
26+
if event.inaxes is not None:
27+
print 'data coords', event.xdata, event.ydata
3228

33-
34-
35-
canvas.mpl_connect('motion_notify_event', on_move)
36-
#canvas.mpl_connect('button_press_event', on_click)
29+
#canvas.mpl_connect('motion_notify_event', on_move)
30+
canvas.mpl_connect('button_press_event', on_click)
3731

3832

3933

0 commit comments

Comments
 (0)