File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ import matplotlib
3+ #matplotlib.use("WxAgg")
4+ #matplotlib.use("TkAgg")
5+ matplotlib .use ("GTKAgg" )
6+ #matplotlib.use("QtAgg")
7+ #matplotlib.use("Qt4Agg")
8+ import matplotlib .pyplot as plt
9+ import math
10+ import numpy
11+
12+ print "***** TESTING WITH BACKEND: %s" % matplotlib .get_backend () + " *****"
13+
14+ def OnClick (event ):
15+ if event .dblclick :
16+ print "DBLCLICK" ,event
17+ else :
18+ print "DOWN" ,event
19+
20+ def OnRelease (event ):
21+ print "UP" ,event
22+
23+
24+ fig = plt .gcf ()
25+ cid_up = fig .canvas .mpl_connect ('button_press_event' ,OnClick )
26+ cid_down = fig .canvas .mpl_connect ('button_release_event' ,OnRelease )
27+
28+ t = numpy .arange (0.0 ,3.0 ,0.01 )
29+ s = numpy .sin (2 * math .pi * t )
30+ plt .plot (t ,s )
31+
32+ plt .show ()
33+
You can’t perform that action at this time.
0 commit comments