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

« back to all changes in this revision

Viewing changes to examples/multiaxis.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-06 19:03:54 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110406190354-rwd55l2ezjecfo41
Tags: 3.4.0-2
d/rules: fix pyshared directory path (Closes: #621116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
"""
13
13
 
14
14
# Major library imports
15
 
from numpy import arange, fabs, pi, sin
 
15
from numpy import arange
16
16
from scipy.special import jn
17
17
 
18
18
from enthought.chaco.example_support import COLOR_PALETTE
20
20
 
21
21
# Enthought library imports
22
22
from enthought.enable.api import Window, Component, ComponentEditor
23
 
from enthought.traits.api import HasTraits, Instance, Dict, false, List
 
23
from enthought.traits.api import HasTraits, Instance
24
24
from enthought.traits.ui.api import Item, Group, View
25
25
 
26
26
# Chaco imports
27
 
from enthought.chaco.api import create_line_plot, add_default_axes, add_default_grids, \
28
 
                                 OverlayPlotContainer, PlotLabel, VPlotContainer, \
29
 
                                 create_scatter_plot, Legend, PlotComponent, PlotAxis
30
 
from enthought.chaco.tools.api import PanTool, RectZoomTool, SimpleZoom, \
31
 
                                       LegendTool, TraitsTool, BroadcasterTool
 
27
from enthought.chaco.api import create_line_plot, add_default_axes, \
 
28
                                add_default_grids, OverlayPlotContainer, \
 
29
                                PlotLabel, Legend, PlotAxis
 
30
from enthought.chaco.tools.api import PanTool, LegendTool, TraitsTool, \
 
31
                                      BroadcasterTool
32
32
 
33
33
#===============================================================================
34
34
# # Create the Chaco plot.
54
54
        plot.bgcolor = "white"
55
55
        plot.border_visible = True
56
56
        if i == 0:
57
 
            plot0 = plot
58
57
            add_default_grids(plot)
59
58
            add_default_axes(plot)
60
59
 
62
61
        # manipulate, but don't attach it to the plot.  Instead, attach it to
63
62
        # the broadcaster.
64
63
        pan = PanTool(plot)
65
 
        #zoom = SimpleZoom(plot, tool_mode="box", always_on=False)
66
64
        broadcaster.tools.append(pan)
67
 
        #broadcaster.tools.append(zoom)
68
65
 
69
66
        container.add(plot)
70
67
        plots["Bessel j_%d"%i] = plot
118
115
                    )
119
116
    
120
117
    def _plot_default(self):
121
 
         return _create_plot_component()
 
118
        return _create_plot_component()
122
119
    
123
120
demo = Demo()
124
121