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

« back to all changes in this revision

Viewing changes to examples/demo/shell/contour.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
 
"""This example demonstrates creating a contour plot using the chaco
2
 
shell subpackage.
3
 
"""
4
 
 
5
 
# Major library imports
6
 
from numpy import linspace, meshgrid, sin
7
 
from scipy.special import jn
8
 
 
9
 
# Enthought library imports
10
 
from chaco.shell import show, title, contour
11
 
 
12
 
 
13
 
# Crate some scalar data
14
 
xs = linspace(-10,10,200)
15
 
ys = linspace(-10,10,400)
16
 
x,y = meshgrid(xs,ys)
17
 
z = sin(x)*x*jn(0,y)
18
 
 
19
 
# Create a contour line plot
20
 
contour(x,y,z, bgcolor="black")
21
 
 
22
 
# Add some titles
23
 
title("contour line plot")
24
 
 
25
 
#This command is only necessary if running from command line
26
 
show()