~ubuntu-branches/ubuntu/vivid/python-chaco/vivid-proposed

« back to all changes in this revision

Viewing changes to examples/basic/contour_cmap_plot.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-06-03 01:43:27 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100603014327-lurshmszk4h96hr8
Tags: 3.3.1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
def _create_plot_component():
30
30
 
31
31
    # Create a scalar field to colormap
 
32
    x_extents = (-2*pi, 2*pi)
 
33
    y_extents = (-1.5*pi, 1.5*pi)
32
34
    xs = linspace(-2*pi, 2*pi, 200)
33
35
    ys = linspace(-1.5*pi, 1.5*pi, 100)
34
36
    x, y = meshgrid(xs,ys)
43
45
    lplot = Plot(pd)
44
46
    lplot.img_plot("imagedata",
45
47
                   name="cm_plot",
46
 
                   xbounds=xs,
47
 
                   ybounds=ys,
 
48
                   xbounds=x_extents,
 
49
                   ybounds=y_extents,
48
50
                   colormap=gmt_drywet)
49
51
    lplot.contour_plot("imagedata", 
50
52
                       type="line",
51
 
                       xbounds=xs,
52
 
                       ybounds=ys)
 
53
                       xbounds=x_extents,
 
54
                       ybounds=y_extents)
53
55
 
54
56
    # Tweak some of the plot properties
55
57
    lplot.title = "Colormap and contours"
82
84
    rplot = Plot(pd, range2d=lplot.range2d)
83
85
    rplot.contour_plot("imagedata", 
84
86
                       type="line",
85
 
                       xbounds=xs,
86
 
                       ybounds=ys,
 
87
                       xbounds=x_extents,
 
88
                       ybounds=y_extents,
87
89
                       bgcolor="black", 
88
90
                       levels=15, 
89
91
                       styles="solid",