4
# Tutorial 9b. Synchronize the Y data space as well,and add some tools.
7
from tutorial8 import PlotFrame
8
from enthought.chaco.tools.api import ZoomTool
10
class PlotFrame2(PlotFrame):
11
def _create_plot(self):
12
container = super(PlotFrame2, self)._create_plot()
14
self.right_plot.index_mapper.range = self.left_plot.index_mapper.range
15
self.right_plot.value_mapper.range = self.left_plot.value_mapper.range
17
self.left_plot.overlays.append(ZoomTool(self.left_plot,
18
tool_mode="box", always_on=False))
19
self.right_plot.overlays.append(ZoomTool(self.right_plot,
20
tool_mode="box", always_on=False))
24
if __name__ == "__main__":
26
app = wx.PySimpleApp()
27
frame = PlotFrame2(None)
1
"""Tutorial 9b. Synchronize the Y data space as well,and add some tools."""
4
from chaco.tools.api import ZoomTool
6
from tutorial8 import PlotExample
9
class PlotExample2(PlotExample):
10
def _container_default(self):
11
container = super(PlotExample2, self)._container_default()
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
17
lplot.overlays.append(ZoomTool(lplot, tool_mode="box",always_on=False))
18
rplot.overlays.append(ZoomTool(rplot, tool_mode="box",always_on=False))
24
if __name__ == "__main__":
25
demo.configure_traits()