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

« back to all changes in this revision

Viewing changes to examples/demo/shell/scatter.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 shows how to create a scatter plot using the `shell` package.
2
 
"""
3
 
 
4
 
# Major library imports
5
 
from numpy import linspace, random, pi
6
 
 
7
 
# Enthought library imports
8
 
from chaco.shell import plot, hold, title, show
9
 
 
10
 
 
11
 
# Create some data
12
 
x = linspace(-2*pi, 2*pi, 100)
13
 
y1 = random.random(100)
14
 
y2 = random.random(100)
15
 
 
16
 
# Create some scatter plots
17
 
plot(x, y1, "b.")
18
 
hold(True)
19
 
plot(x, y2, "g+", marker_size=2)
20
 
 
21
 
# Add some titles
22
 
title("simple scatter plots")
23
 
 
24
 
# This command is only necessary if running from command line
25
 
show()