Sophie

Sophie

distrib > Mandriva > current > i586 > by-pkgid > ae0a4f27f26602dc31c3bf35e18b5b19 > files > 559

python-enthought-chaco-3.4.0-2mdv2010.2.i586.rpm

#!/usr/bin/env python
#
#
# Tutorial 10b. Connecting the plots at the data source level


from tutorial9b import PlotFrame2
from enthought.chaco.tools.api import LineInspector

class PlotFrame3(PlotFrame2):
    def _create_plot(self):
        container = super(PlotFrame3, self)._create_plot()
        
        self.left_plot.overlays.append(LineInspector(component=self.left_plot,
                write_metadata=True, is_listener=True))
        
        self.right_plot.overlays.append(LineInspector(component=self.right_plot,
                write_metadata=True, is_listener=True))
        
        self.right_plot.index = self.left_plot.index 
        
        return container

if __name__ == "__main__":
    import wx
    app = wx.PySimpleApp()
    frame = PlotFrame3(None)
    app.MainLoop()