Mike,
Thank you for your suggestion.
I found that pan mode doesn't work as expected in page of notebook.
The sample code is attached.
Thanks for your further guidance in advance.
On Nov 8, 2007 9:27 PM, Michael Droettboom <[EMAIL PROTECTED]> wrote:
> All I can suggest is that you compare this script you provided (which
> works) to the one that's broken (your application), and try to determine
> which difference is causing it to break. Once you've put that
> difference into a short script and we can reproduce it, we'll have a
> better idea of what the root cause might be and whether there's a
> workaround.
>
> Cheers,
> Mike
>
>
--
sunzen
<<freedom & enjoyment>>
#!/usr/bin/env python
#
import gtk
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar
from matplotlib.numerix import *
class BaseView(FigureCanvas):
def __init__(self, numgraphs = 2):
self.axlist = []
self.fig = Figure()
self.axlist.append(self.fig.add_subplot(numgraphs, 1 ,1))
for i in range(2, numgraphs + 1):
self.axlist.append(self.fig.add_subplot(numgraphs, 1 ,i, sharex = self.axlist[0],autoscale_on = False))
FigureCanvas.__init__(self, self.fig)
class ViewOne(BaseView):
def __init__(self):
BaseView.__init__(self, numgraphs = 2)
t = arange(0.0, 2.0, 0.01)
y1 = sin(2*pi*t)
y2 = cos(2*pi*t)
self.axlist[0].plot(t,y1,picker = 5)
self.axlist[1].plot(t,y2,picker = 5)
class testapp():
def __init__(self):
self.window = gtk.Window()
self.window.set_default_size(800,600)
self.nb = gtk.Notebook()
self.window.add(self.nb)
self.vbox = gtk.VBox()
self.view = ViewOne()
self.vbox.pack_start(self.view, True, True, 0)
navbar = NavigationToolbar(self.view, self.window)
self.vbox.pack_start(navbar, False, False,0)
self.nb_label0 = gtk.Label("page0")
self.nb.append_page(self.vbox,self.nb_label0)
self.view.mpl_connect('pick_event', self.onpick)
def main(self):
self.window.show_all()
gtk.main()
def onpick(self,event):
picked_axes = event.mouseevent.inaxes
if picked_axes == self.view.axlist[0]:
print "pick in ax[0]"
else:
print "pick in ax[1]"
if __name__ == "__main__":
app = testapp()
app.main()
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users