Sophie

Sophie

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

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

#!/usr/bin/env python
#
#
# Tutorial 5. Coordinating different tools

from tutorial2 import myplot, PlotFrame, main

from enthought.chaco.tools.api import PanTool, ZoomTool

# The ZoomTool tool has a visual component, so it needs to be added to the
# list of overlays instead of the list of bare tools.
myplot.tools.append(PanTool(myplot))
myplot.overlays.append(ZoomTool(myplot, tool_mode="box", always_on=False))

# And now we just run it.
if __name__ == "__main__":
    main()