2
Draws a static polar plot.
5
# Major library imports
6
from numpy import arange, pi, cos
8
# Enthought library imports
9
from enable.api import Component, ComponentEditor
10
from traits.api import HasTraits, Instance
11
from traitsui.api import Item, Group, View
14
from chaco.api import create_polar_plot
16
#===============================================================================
17
# # Create the Chaco plot.
18
#===============================================================================
19
def _create_plot_component():
25
theta = arange(low, high, (high-low) / numpoints)
27
# Create the radius data
30
# Create a new polar plot with radius and theta data
31
plot = create_polar_plot((radius,theta),color=(0.0,0.0,1.0,1), width=4.0)
35
#===============================================================================
36
# Attributes to use for the plot view.
38
title="Simple Polar Plot"
40
#===============================================================================
41
# # Demo class that is used by the demo.py application.
42
#===============================================================================
43
class Demo(HasTraits):
44
plot = Instance(Component)
48
Item('plot', editor=ComponentEditor(size=size),
50
orientation = "vertical"),
51
resizable=True, title=title,
52
width=size[0], height=size[1]
55
def _plot_default(self):
56
return _create_plot_component()
60
if __name__ == "__main__":
61
demo.configure_traits()
63
# EOF#######################