2
from numpy import linspace, sin
3
from chaco.api import ArrayPlotData, Plot
4
from enable.component_editor import ComponentEditor
5
from traits.api import HasTraits, Instance
6
from traitsui.api import Item, View
8
class ScatterPlot(HasTraits):
13
Item('plot', editor=ComponentEditor(),
15
width=500, height=500,
20
# Create the data and the PlotData object
21
x = linspace(-14, 14, 100)
23
plotdata = ArrayPlotData(x = x, y = y)
24
# Create a Plot and associate it with the PlotData
26
# Create a scatter plot in the Plot
27
plot.plot(("x", "y"), type="scatter", color="blue")
30
#===============================================================================
31
# demo object that is used by the demo.py application.
32
#===============================================================================
35
if __name__ == "__main__":
36
demo.configure_traits()