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

« back to all changes in this revision

Viewing changes to examples/tutorials/tutorial2.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 2. Creating a plot in window.
2
 
 
3
 
Using a traitsui view, a plot can be placed as a configurable item that is
4
 
viewed when configure_traits is called.
5
 
"""
6
 
 
7
 
from enable.api import ComponentEditor
8
 
from traits.api import HasTraits
9
 
from traitsui.api import Item, View
10
 
 
11
 
 
12
 
from tutorial1 import myplot
13
 
 
14
 
class PlotExample(HasTraits):
15
 
    plot = myplot
16
 
 
17
 
    traits_view = View(Item('plot', editor=ComponentEditor(), show_label=False),
18
 
                       title="Chaco Tutorial")
19
 
 
20
 
demo = PlotExample()
21
 
 
22
 
if __name__ == "__main__":
23
 
    demo.configure_traits()