Exemplo n.º 1
0
"""Tutorial 5. Coordinating different tools

We can add multiple tools on the sample plot
"""

from tutorial2 import demo

from chaco.tools.api import PanTool, ZoomTool

plot = demo.plot
plot.tools.append(PanTool(plot))
plot.overlays.append(ZoomTool(plot, tool_mode="box", always_on=False))

if __name__ == "__main__":
    demo.configure_traits()
Exemplo n.º 2
0
"""Tutorial 4. Adding a zoom tool

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.
"""

from chaco.tools.api import ZoomTool

from tutorial2 import demo

plot = demo.plot
plot.overlays.append(ZoomTool(plot, tool_mode="box", always_on=True))

if __name__ == "__main__":
    demo.configure_traits()