2
from numpy import linspace, cos, sin
4
from chaco.api import ArrayPlotData, Plot
5
from enable.component_editor import ComponentEditor
6
from traits.api import HasTraits, Instance
7
from traitsui.api import Item, View
9
class OverlappingExample(HasTraits):
13
traits_view = View(Item('plot', editor=ComponentEditor(), show_label=False),
14
width=800, height=600, resizable=True,
18
# Create the data and the PlotData object
19
x = linspace(-14, 14, 100)
22
plotdata = ArrayPlotData(x=x, y=y, y2=y2)
23
# Create a Plot and associate it with the PlotData
25
# Create a scatter plot in the Plot
26
plot.plot(("x", "y"), type="scatter", color="blue")
27
# Create an overlapping line plot
28
plot.plot(("x", "y2"), type="line", color="red")
31
#===============================================================================
32
# demo object that is used by the demo.py application.
33
#===============================================================================
34
demo = OverlappingExample()
35
if __name__ == "__main__":
36
demo.configure_traits()