~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to examples/tutorials/tutorial9b.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""Tutorial 9b. Synchronize the Y data space as well,and add some tools."""
2
 
 
3
 
 
4
 
from chaco.tools.api import ZoomTool
5
 
 
6
 
from tutorial8 import PlotExample
7
 
 
8
 
 
9
 
class PlotExample2(PlotExample):
10
 
    def _container_default(self):
11
 
        container = super(PlotExample2, self)._container_default()
12
 
 
13
 
        rplot, lplot = self.right_plot, self.left_plot
14
 
        rplot.index_mapper.range = lplot.index_mapper.range
15
 
        rplot.value_mapper.range = lplot.value_mapper.range
16
 
 
17
 
        lplot.overlays.append(ZoomTool(lplot, tool_mode="box",always_on=False))
18
 
        rplot.overlays.append(ZoomTool(rplot, tool_mode="box",always_on=False))
19
 
 
20
 
        return container
21
 
 
22
 
demo = PlotExample2()
23
 
 
24
 
if __name__ == "__main__":
25
 
    demo.configure_traits()